{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2010-02-04 00:00:00\n",
      "72 500\n",
      "(72, 500, 3) (72, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00230882 0.00177702 0.0020892  0.0021647  0.00203659 0.0019991\n",
      " 0.00201831 0.00200232 0.00207982 0.0020423  0.00204932 0.00168913\n",
      " 0.0022053  0.00198271 0.00208384 0.00219199 0.00190289 0.00203857\n",
      " 0.00175248 0.00217168 0.00204077 0.00214093 0.00140682 0.00122786\n",
      " 0.00178936 0.00204622 0.00214811 0.00205559 0.00227636 0.00194232\n",
      " 0.00192465 0.00200804 0.00205428 0.00196245 0.00209328 0.00213624\n",
      " 0.00187208 0.00185341 0.00199482 0.00205797 0.00218903 0.00189245\n",
      " 0.00211904 0.0022786  0.00205727 0.00194441 0.00207887 0.00195937\n",
      " 0.00207314 0.00188086 0.00218933 0.00200857 0.00198794 0.00209809\n",
      " 0.00211366 0.00167386 0.00173819 0.00189983 0.00187256 0.00200757\n",
      " 0.00218987 0.00221227 0.00228815 0.00214527 0.00208326 0.00177391\n",
      " 0.00183642 0.00189052 0.00205445 0.00168806 0.00213603 0.00185248\n",
      " 0.00207287 0.0019317  0.00189932 0.00192684 0.00173731 0.00209233\n",
      " 0.00208259 0.00211375 0.00216113 0.00221404 0.00201718 0.00193247\n",
      " 0.00204484 0.00221757 0.00249668 0.00218918 0.00224064 0.00204209\n",
      " 0.00191825 0.00193028 0.00123604 0.00207831 0.00199103 0.0021292\n",
      " 0.002018   0.00204725 0.00206664 0.00172001 0.00202892 0.00141509\n",
      " 0.00225008 0.00222582 0.00213766 0.00219599 0.00215045 0.00218661\n",
      " 0.00210762 0.00199057 0.00201493 0.00211352 0.00237583 0.00205488\n",
      " 0.00189026 0.00201989 0.00195373 0.00175681 0.00195214 0.00206163\n",
      " 0.00226888 0.00207511 0.0017901  0.00226547 0.00184757 0.00211817\n",
      " 0.00192267 0.00190324 0.00192596 0.00215042 0.00206491 0.00198803\n",
      " 0.00238952 0.00223804 0.00191466 0.00209276 0.00215019 0.00216909\n",
      " 0.00200682 0.00201694 0.00213216 0.00217059 0.00209747 0.00182893\n",
      " 0.00209139 0.00224645 0.00196614 0.0019014  0.00216311 0.00204245\n",
      " 0.0020787  0.00238656 0.0019743  0.00211476 0.00188288 0.00183221\n",
      " 0.00198456 0.0018393  0.00222369 0.00218592 0.00180221 0.00198932\n",
      " 0.00212772 0.00194364 0.00233488 0.0019883  0.00211793 0.00173117\n",
      " 0.00244871 0.00163185 0.00191778 0.00208813 0.00173232 0.00200876\n",
      " 0.00180994 0.00207639 0.00206582 0.00209057 0.00197484 0.00226796\n",
      " 0.00198667 0.00189627 0.00202956 0.00172944 0.00208163 0.00206771\n",
      " 0.00223286 0.00197187 0.00206024 0.00194581 0.0018621  0.00199751\n",
      " 0.00201248 0.00177684 0.00223475 0.00199994 0.00200556 0.00199984\n",
      " 0.00201771 0.00198306 0.00174462 0.00199952 0.0021649  0.002027\n",
      " 0.00175768 0.00199433 0.00197102 0.00206914 0.00168053 0.00213635\n",
      " 0.00219641 0.00217018 0.00199959 0.00123179 0.00204689 0.00210609\n",
      " 0.00206598 0.00217527 0.00200731 0.00182994 0.00199294 0.00195235\n",
      " 0.00183971 0.00230713 0.00210766 0.002093   0.00178204 0.00203157\n",
      " 0.00193404 0.00208725 0.00225799 0.00199037 0.00185832 0.00198675\n",
      " 0.0017784  0.00123374 0.00192991 0.00228472 0.00203106 0.00208859\n",
      " 0.00179758 0.00212163 0.00189233 0.0019709  0.00215651 0.00201776\n",
      " 0.00208386 0.00190817 0.00180029 0.00212116 0.00209108 0.00197549\n",
      " 0.00196175 0.00201975 0.00197981 0.00199554 0.00187865 0.00203662\n",
      " 0.00136042 0.00193163 0.00169549 0.00122692 0.00209881 0.00159278\n",
      " 0.00173928 0.00202713 0.00206771 0.0015059  0.00201051 0.00207671\n",
      " 0.00180151 0.00208691 0.00200686 0.00183806 0.00213612 0.0018149\n",
      " 0.00208284 0.0019111  0.00199254 0.00178093 0.00192004 0.00139519\n",
      " 0.0021887  0.00227918 0.00199547 0.00173116 0.00200569 0.00200806\n",
      " 0.00242854 0.00211061 0.00207792 0.00203054 0.00198675 0.00190594\n",
      " 0.00202619 0.00171803 0.00202594 0.00168682 0.00170803 0.00200091\n",
      " 0.00203388 0.00218965 0.00234971 0.0019596  0.00193721 0.00169017\n",
      " 0.00191199 0.00174492 0.00182675 0.00207668 0.00148323 0.00172602\n",
      " 0.00180834 0.00205604 0.00206771 0.00208155 0.00183782 0.00177883\n",
      " 0.00196703 0.00207592 0.00193424 0.0023652  0.00187645 0.0019492\n",
      " 0.00195891 0.00226272 0.00123095 0.00200016 0.00204113 0.00148921\n",
      " 0.00174774 0.00163805 0.00211696 0.00195091 0.00200234 0.0017943\n",
      " 0.00198808 0.00191129 0.00194462 0.00192891 0.00214024 0.00164713\n",
      " 0.00197598 0.00204736 0.00200019 0.00213506 0.00205808 0.00187553\n",
      " 0.00233662 0.00134533 0.00144473 0.00188648 0.00235873 0.0021664\n",
      " 0.00231742 0.0020117  0.00203453 0.00162827 0.00224291 0.00190573\n",
      " 0.00206803 0.00157273 0.00196433 0.0020175  0.0019635  0.00199228\n",
      " 0.00197604 0.00125934 0.00206039 0.00210622 0.00183677 0.00195801\n",
      " 0.00203029 0.00207919 0.0020148  0.00218278 0.00205859 0.00202781\n",
      " 0.00206771 0.00210566 0.00222853 0.00202749 0.00210097 0.00201072\n",
      " 0.00214444 0.00226185 0.00201816 0.0012372  0.00207978 0.00202896\n",
      " 0.00221556 0.00185367 0.00168184 0.00204093 0.00123052 0.00200097\n",
      " 0.00203274 0.00213629 0.0020849  0.00206742 0.00202773 0.00232169\n",
      " 0.0019226  0.00221628 0.00213817 0.00223112 0.00168155 0.00170591\n",
      " 0.00209067 0.00192852 0.00229143 0.00206089 0.00164315 0.00207926\n",
      " 0.00219271 0.00123355 0.00199758 0.00198614 0.00217128 0.00216667\n",
      " 0.00200536 0.00219839 0.00199743 0.00212372 0.00207735 0.00199372\n",
      " 0.00202972 0.00193666 0.00201017 0.00227606 0.00205349 0.00185989\n",
      " 0.00189174 0.00214591 0.00203084 0.00215154 0.00172191 0.0023745\n",
      " 0.00184242 0.00195078 0.00208078 0.00217678 0.00157065 0.00187366\n",
      " 0.00202185 0.00227624 0.00202942 0.00191051 0.00233051 0.00171204\n",
      " 0.00184896 0.00215264 0.00179003 0.00201814 0.00222053 0.00211096\n",
      " 0.00199827 0.00196975 0.00211493 0.00202635 0.00189998 0.00212305\n",
      " 0.0022798  0.00229769 0.00214186 0.00204147 0.00217404 0.00227418\n",
      " 0.00225947 0.00231046 0.00212895 0.00202639 0.00209903 0.00208648\n",
      " 0.00219944 0.00214142 0.00203052 0.00202162 0.00223151 0.0020868\n",
      " 0.00197362 0.00217611 0.00188264 0.00209396 0.00213404 0.00220274\n",
      " 0.00220763 0.00224283 0.00203715 0.00208998 0.00235529 0.00205365\n",
      " 0.00186124 0.00223204 0.00224265 0.00204197 0.00205649 0.00224316\n",
      " 0.00222874 0.00217245]\n",
      "2010-02-05 00:00:00\n",
      "72 500\n",
      "(72, 500, 3) (72, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00054537 0.00094524 0.00186608 0.00735131 0.00129252 0.00105859\n",
      " 0.00286324 0.00074149 0.00183215 0.0008766  0.00458866 0.00086923\n",
      " 0.00110476 0.00048821 0.0007163  0.00081332 0.00223259 0.00606688\n",
      " 0.00593678 0.00053768 0.00110872 0.00868695 0.00055671 0.00092064\n",
      " 0.00113298 0.00686798 0.00383521 0.00363485 0.00068217 0.00091385\n",
      " 0.00206743 0.00113996 0.00513059 0.00486053 0.0014292  0.00112363\n",
      " 0.00264411 0.00050501 0.00248118 0.00076803 0.00087856 0.00095584\n",
      " 0.00123341 0.00106902 0.00177089 0.00102341 0.00287003 0.00164531\n",
      " 0.00077484 0.00633042 0.00303025 0.0031308  0.00103721 0.00071743\n",
      " 0.00204902 0.00097157 0.00466292 0.00071418 0.00545361 0.00082608\n",
      " 0.00306364 0.00079547 0.00086978 0.00124558 0.00056189 0.00334362\n",
      " 0.00057485 0.00844797 0.00088905 0.00080064 0.0008034  0.00104483\n",
      " 0.00098686 0.0012145  0.00135374 0.00204272 0.00732242 0.00051315\n",
      " 0.00115636 0.00551346 0.00557858 0.00120024 0.00086458 0.00184979\n",
      " 0.00789535 0.0008034  0.0021462  0.0008572  0.0051306  0.00114285\n",
      " 0.0050698  0.00152261 0.00059891 0.00189698 0.00062004 0.00102892\n",
      " 0.00349872 0.0008866  0.00310438 0.00120649 0.00109724 0.0005185\n",
      " 0.00254702 0.00580024 0.00188445 0.00205689 0.00096783 0.0062261\n",
      " 0.00098751 0.00087789 0.00082111 0.00419056 0.00089106 0.00131466\n",
      " 0.00074935 0.00573461 0.0015758  0.00284206 0.0015179  0.0022896\n",
      " 0.0008602  0.0006045  0.00102233 0.0009019  0.00093497 0.00109127\n",
      " 0.00075593 0.00043161 0.0009094  0.00313414 0.00067556 0.00079814\n",
      " 0.00135318 0.0008622  0.00526391 0.00102179 0.00293874 0.00101721\n",
      " 0.0005254  0.00174239 0.00082916 0.00149228 0.00075443 0.0004879\n",
      " 0.00102568 0.00179708 0.00313807 0.00347191 0.00106366 0.00148941\n",
      " 0.00089129 0.00050418 0.00074086 0.00087494 0.00125419 0.00246649\n",
      " 0.00105415 0.00705782 0.00125032 0.00098438 0.0038425  0.00055677\n",
      " 0.00091772 0.00105069 0.00073684 0.00103399 0.0011118  0.00362886\n",
      " 0.0005529  0.00058354 0.00119176 0.00156418 0.00611568 0.00615664\n",
      " 0.00079584 0.00113474 0.00094194 0.00393263 0.00125452 0.00133273\n",
      " 0.00221807 0.00195848 0.00080283 0.00466254 0.00104881 0.00580024\n",
      " 0.00120079 0.0013429  0.00789387 0.00150885 0.00066945 0.00120445\n",
      " 0.00167135 0.00347777 0.00128596 0.00146083 0.00132549 0.00121569\n",
      " 0.00063615 0.00088128 0.00140402 0.00084593 0.0062356  0.00129727\n",
      " 0.00459525 0.00086629 0.00082636 0.00125683 0.00220715 0.00097458\n",
      " 0.00095732 0.0015951  0.00087241 0.00053319 0.00106277 0.00151887\n",
      " 0.00463544 0.00277011 0.00078347 0.00161344 0.00281933 0.00145428\n",
      " 0.00084112 0.00059259 0.00104032 0.00103453 0.00823628 0.00230642\n",
      " 0.00091047 0.00076244 0.00087555 0.00125397 0.00085039 0.00155496\n",
      " 0.00136014 0.00036552 0.00083423 0.00066707 0.00075231 0.00141989\n",
      " 0.00180038 0.00329935 0.00498445 0.00119498 0.00063326 0.00115234\n",
      " 0.00130865 0.00106006 0.0005111  0.00085234 0.00087136 0.00089403\n",
      " 0.00158208 0.00112807 0.0090958  0.00580024 0.00352731 0.00102149\n",
      " 0.00372864 0.00096121 0.00884101 0.00083396 0.00080137 0.00282457\n",
      " 0.00501263 0.0009756  0.00580024 0.00085377 0.00086793 0.00598487\n",
      " 0.00618358 0.001238   0.00076754 0.00095325 0.00080103 0.00089755\n",
      " 0.00133477 0.00128992 0.00123498 0.00061818 0.00118287 0.00580024\n",
      " 0.000848   0.00071489 0.00087558 0.00224708 0.00180331 0.00100264\n",
      " 0.00056524 0.00081567 0.00078681 0.0013501  0.00113979 0.00087839\n",
      " 0.00075262 0.00180688 0.00216729 0.00326239 0.00117559 0.00081045\n",
      " 0.00054772 0.0006368  0.00140208 0.00062278 0.00101096 0.00191481\n",
      " 0.00075911 0.00048769 0.00102553 0.00333113 0.00063567 0.000521\n",
      " 0.00091023 0.00283904 0.00338572 0.00089282 0.00179334 0.0079638\n",
      " 0.00338995 0.00275748 0.00410759 0.00072658 0.00451289 0.00138731\n",
      " 0.0042459  0.00603279 0.00105211 0.00074344 0.00121823 0.00057033\n",
      " 0.00101645 0.0039897  0.00059829 0.00688036 0.00303633 0.00459408\n",
      " 0.00361405 0.00069809 0.00077633 0.00161672 0.00112305 0.00036272\n",
      " 0.00099993 0.00095628 0.00160466 0.00109321 0.00101563 0.00122303\n",
      " 0.00291265 0.00033334 0.00033179 0.00236982 0.00315947 0.00109453\n",
      " 0.00410992 0.00738802 0.00119175 0.00120647 0.00128547 0.00275449\n",
      " 0.00778275 0.00132971 0.00208585 0.00197428 0.00094764 0.00580024\n",
      " 0.00083314 0.00068022 0.00082089 0.00113177 0.00169431 0.0004776\n",
      " 0.00112211 0.00109486 0.00507513 0.00165523 0.00133113 0.00942617\n",
      " 0.00346841 0.00062834 0.00062134 0.00580024 0.00068457 0.00078247\n",
      " 0.00085114 0.001628   0.00078625 0.00252585 0.0011949  0.0007201\n",
      " 0.00054945 0.00209723 0.00056246 0.00085957 0.00067056 0.00105392\n",
      " 0.0071181  0.00101384 0.00183807 0.00055127 0.00104894 0.00080272\n",
      " 0.00095324 0.00580024 0.00119345 0.00358395 0.00116096 0.00439372\n",
      " 0.00087626 0.00611605 0.00107608 0.00450489 0.00088888 0.00664308\n",
      " 0.00320181 0.00032009 0.00110111 0.00115024 0.000656   0.0018912\n",
      " 0.00332267 0.00413292 0.00064964 0.00186237 0.00194255 0.00289252\n",
      " 0.00340731 0.0011592  0.00109511 0.00127374 0.00112336 0.00353741\n",
      " 0.00082828 0.00107571 0.00150668 0.0010872  0.00580024 0.00261212\n",
      " 0.00080044 0.00639672 0.00651883 0.00095022 0.00308222 0.00121654\n",
      " 0.00110492 0.00444135 0.0009034  0.00060965 0.00062151 0.0049432\n",
      " 0.00198375 0.00260392 0.00750881 0.00108234 0.00091304 0.00087102\n",
      " 0.00099519 0.0012335  0.0010049  0.00118192 0.00117881 0.00181721\n",
      " 0.00082903 0.00084175 0.0011581  0.00123084 0.0010686  0.0008555\n",
      " 0.00071355 0.00139584 0.00490637 0.00090827 0.00068693 0.00072055\n",
      " 0.00131648 0.0008989  0.00580024 0.00128969 0.00068456 0.00090166\n",
      " 0.00093918 0.00580024 0.00149219 0.00112408 0.00093511 0.00098374\n",
      " 0.00103084 0.00159509 0.00048482 0.00307924 0.00077414 0.00041378\n",
      " 0.00194374 0.00055334 0.00070663 0.00139552 0.0013175  0.00185144\n",
      " 0.00089451 0.00064815]\n",
      "2010-02-08 00:00:00\n",
      "70 500\n",
      "(70, 500, 3) (70, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00196475 0.00203935 0.00197774 0.00205766 0.00204136 0.00207359\n",
      " 0.00199902 0.00202809 0.00199402 0.0020622  0.0020306  0.00196835\n",
      " 0.00198448 0.00201338 0.00197027 0.00194216 0.00178452 0.0020054\n",
      " 0.00208999 0.00209889 0.00202566 0.00205589 0.00208515 0.00195766\n",
      " 0.00198668 0.00205947 0.00200179 0.00204934 0.0019539  0.0019388\n",
      " 0.00195512 0.00200409 0.0019569  0.0020969  0.00201728 0.00200548\n",
      " 0.00192254 0.00204023 0.00197161 0.00193379 0.00199971 0.00195864\n",
      " 0.00200318 0.00203115 0.00195431 0.00193716 0.00198727 0.0020088\n",
      " 0.00197738 0.00201714 0.00200445 0.00201092 0.00207552 0.00201995\n",
      " 0.00206814 0.00204294 0.00205436 0.00206759 0.00202611 0.00199564\n",
      " 0.00200941 0.00199494 0.00195186 0.00199768 0.00201551 0.00199722\n",
      " 0.00201378 0.00203359 0.00198132 0.00197507 0.00199369 0.00198677\n",
      " 0.00192571 0.00199971 0.00201402 0.00203823 0.00207628 0.0020546\n",
      " 0.00197209 0.00199039 0.00185656 0.00198332 0.00184597 0.00202038\n",
      " 0.0020793  0.00206511 0.00200532 0.00197849 0.00196456 0.00196005\n",
      " 0.00205324 0.00191331 0.00217766 0.00196045 0.00199457 0.00200439\n",
      " 0.00203692 0.00195343 0.00213201 0.00207473 0.00197632 0.00198766\n",
      " 0.00212437 0.00200035 0.00199359 0.00207486 0.00203778 0.00205998\n",
      " 0.00196728 0.00200236 0.00199157 0.00201312 0.002023   0.00196161\n",
      " 0.00204488 0.0019966  0.00200365 0.00199971 0.0019648  0.0019896\n",
      " 0.00196939 0.00197    0.00196146 0.00196646 0.00204462 0.00198344\n",
      " 0.00194681 0.0021619  0.00200365 0.00202103 0.00193394 0.00201115\n",
      " 0.00196846 0.00198794 0.0021165  0.00196361 0.00207458 0.00198647\n",
      " 0.00209611 0.00199927 0.00203037 0.00202768 0.00198643 0.00206661\n",
      " 0.00200936 0.00198091 0.00203577 0.00202292 0.00204704 0.00201041\n",
      " 0.00202463 0.0020473  0.00197695 0.00197567 0.00201595 0.00196967\n",
      " 0.00199718 0.00204586 0.00202506 0.00206488 0.00205287 0.00196038\n",
      " 0.00204167 0.00196862 0.00198724 0.00198254 0.00197387 0.00210976\n",
      " 0.0019425  0.00202634 0.00199434 0.00197257 0.00200411 0.00200057\n",
      " 0.00205872 0.00198807 0.00199971 0.00197883 0.00207497 0.00205523\n",
      " 0.00199581 0.00207691 0.00204039 0.00199285 0.00195965 0.00199971\n",
      " 0.00202704 0.00196641 0.00200276 0.00193031 0.00200956 0.00196903\n",
      " 0.00195506 0.00199722 0.00200319 0.0019258  0.00196554 0.00197779\n",
      " 0.00196432 0.00200748 0.00199325 0.00198218 0.00200862 0.00199178\n",
      " 0.00198926 0.00198834 0.0019981  0.00197147 0.00194232 0.00204995\n",
      " 0.00199707 0.00200069 0.00203182 0.00179241 0.00205439 0.00195258\n",
      " 0.00229573 0.00194036 0.00218622 0.00190605 0.00197613 0.00199286\n",
      " 0.00204448 0.00207187 0.00201772 0.00205558 0.00210684 0.00208723\n",
      " 0.00178579 0.00200302 0.00197596 0.00199583 0.00193814 0.00201521\n",
      " 0.00192002 0.00178023 0.00198061 0.0020068  0.00203215 0.00194937\n",
      " 0.00198098 0.00199505 0.00201627 0.00198396 0.00192415 0.00198161\n",
      " 0.0019651  0.00202984 0.00195255 0.0020136  0.00200431 0.00200642\n",
      " 0.00197701 0.00199154 0.00178767 0.00197765 0.00200855 0.00196735\n",
      " 0.0020385  0.00204099 0.00206342 0.00202985 0.00197522 0.00200561\n",
      " 0.00192378 0.00198557 0.00199971 0.00177827 0.00202718 0.00192608\n",
      " 0.00212487 0.00199741 0.00199937 0.00203626 0.00206517 0.00198653\n",
      " 0.00201686 0.00198876 0.00209538 0.00213131 0.00195223 0.00200128\n",
      " 0.00202331 0.00199071 0.0017829  0.00209325 0.00178655 0.00202684\n",
      " 0.00202219 0.00195781 0.00203558 0.00196263 0.00204894 0.0019903\n",
      " 0.00198251 0.0020052  0.00197391 0.00199613 0.00199639 0.00201092\n",
      " 0.00199239 0.00202616 0.0020881  0.00200122 0.00199164 0.00198034\n",
      " 0.0020479  0.0019611  0.00197582 0.00200428 0.0020542  0.00203037\n",
      " 0.00204438 0.00197688 0.0020334  0.00199271 0.00208063 0.00209082\n",
      " 0.00192198 0.00195863 0.0019752  0.00198513 0.0020095  0.00206748\n",
      " 0.00200619 0.0020802  0.00203851 0.00200949 0.00202558 0.00199277\n",
      " 0.00199627 0.00203951 0.00205393 0.00203045 0.00203377 0.0020673\n",
      " 0.00199212 0.00195187 0.00195234 0.00200033 0.00204309 0.00203833\n",
      " 0.00201282 0.00199695 0.00198503 0.00193506 0.00200151 0.0019832\n",
      " 0.00207404 0.00196449 0.00193437 0.00200572 0.00190705 0.00181481\n",
      " 0.00205072 0.00204363 0.00197111 0.00197069 0.00202577 0.00200622\n",
      " 0.00200667 0.00201656 0.00178945 0.00205084 0.00201023 0.00199519\n",
      " 0.00193566 0.00199971 0.00199038 0.00198003 0.00203446 0.00201413\n",
      " 0.00194033 0.00200682 0.00201603 0.00199971 0.00196558 0.00179443\n",
      " 0.00177624 0.00201146 0.00196405 0.00201569 0.00203907 0.00198097\n",
      " 0.00201712 0.0019904  0.0019963  0.00177943 0.00197201 0.00200991\n",
      " 0.00197764 0.00198737 0.00213372 0.00204954 0.00195603 0.00190999\n",
      " 0.00199631 0.00197992 0.00190358 0.00211152 0.00200014 0.00199129\n",
      " 0.00200152 0.00199813 0.0019751  0.00202298 0.00201268 0.00194112\n",
      " 0.00178437 0.00202104 0.00198293 0.00198228 0.00207698 0.00196585\n",
      " 0.00199665 0.00199971 0.002122   0.00194142 0.00200743 0.00192244\n",
      " 0.00202575 0.00199141 0.00198448 0.00196472 0.00204822 0.00190415\n",
      " 0.00200314 0.00190995 0.00199971 0.00212241 0.00193648 0.00196821\n",
      " 0.00201073 0.00198026 0.00203391 0.00192205 0.00200332 0.0020944\n",
      " 0.00202759 0.00203485 0.00207699 0.00201014 0.00206328 0.00198233\n",
      " 0.00208834 0.00198263 0.00201428 0.00204493 0.00200824 0.00204971\n",
      " 0.00207291 0.00197432 0.00201757 0.00209386 0.0020105  0.00208888\n",
      " 0.00206239 0.00196219 0.00204196 0.00203049 0.00181434 0.00201133\n",
      " 0.00184738 0.00202052 0.00199168 0.00202445 0.00208551 0.00197817\n",
      " 0.00202321 0.00200835 0.00207696 0.00196836 0.00203505 0.00199783\n",
      " 0.00197883 0.00203513 0.00200761 0.00201082 0.00197806 0.00200337\n",
      " 0.00197597 0.00200515 0.00196704 0.00202599 0.00199898 0.00195767\n",
      " 0.0020191  0.00199971 0.00209123 0.00198222 0.00197726 0.00196495\n",
      " 0.00201764 0.00207412 0.00200058 0.00201585 0.00186031 0.00199467\n",
      " 0.00199287 0.00196983]\n",
      "2010-02-09 00:00:00\n",
      "71 500\n",
      "(71, 500, 3) (71, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00198392 0.00192395 0.00201017 0.00196108 0.00203005 0.00201114\n",
      " 0.00204238 0.00202524 0.0020041  0.00201542 0.00203536 0.00199323\n",
      " 0.00200465 0.00201915 0.00199649 0.00202384 0.00206507 0.00201416\n",
      " 0.00205906 0.00199186 0.00200262 0.00205116 0.00199056 0.00206462\n",
      " 0.00199677 0.00195187 0.00200799 0.00194681 0.00199375 0.00206436\n",
      " 0.00191473 0.00200555 0.00200143 0.00202108 0.00197602 0.00200175\n",
      " 0.00201823 0.00201409 0.00201156 0.00202635 0.00200331 0.00200474\n",
      " 0.00200125 0.00198841 0.00199132 0.0020125  0.00199398 0.00202659\n",
      " 0.00197801 0.00203772 0.00199146 0.00198632 0.0019807  0.0019655\n",
      " 0.00199731 0.00199815 0.00203886 0.00191854 0.00202125 0.00198506\n",
      " 0.0019539  0.00199243 0.00195709 0.00201272 0.00199351 0.00199193\n",
      " 0.00200697 0.00199352 0.00191021 0.00203353 0.00198254 0.00196586\n",
      " 0.00198    0.00200115 0.00198347 0.00202814 0.00188417 0.00199538\n",
      " 0.00198442 0.00200299 0.001988   0.00202898 0.00199928 0.00200757\n",
      " 0.00197656 0.00188684 0.00199351 0.00200372 0.00202434 0.00199669\n",
      " 0.00207136 0.00198547 0.00204142 0.00198666 0.00197347 0.00192006\n",
      " 0.0020661  0.0020291  0.0020409  0.00199126 0.0020123  0.00204704\n",
      " 0.00204719 0.00202234 0.00201716 0.00197519 0.00196866 0.00204345\n",
      " 0.00198345 0.0020451  0.0019871  0.00190321 0.00198781 0.00195619\n",
      " 0.00203127 0.00199336 0.00196805 0.00200174 0.00201059 0.00195167\n",
      " 0.00198677 0.00195677 0.00198801 0.00204017 0.00208145 0.00190058\n",
      " 0.00204297 0.00198662 0.00196752 0.00203374 0.00204795 0.00197648\n",
      " 0.00200294 0.00196008 0.00205076 0.00200896 0.00202242 0.00196479\n",
      " 0.00197613 0.00196837 0.00196843 0.00198384 0.00199529 0.00202334\n",
      " 0.00196827 0.00196001 0.00198211 0.00200871 0.0019799  0.00198495\n",
      " 0.00196788 0.00210028 0.00195026 0.00202811 0.00198338 0.00197732\n",
      " 0.0019295  0.00197501 0.00198662 0.00201101 0.00208286 0.00201499\n",
      " 0.00200668 0.00197826 0.00195572 0.00200634 0.00201643 0.00202835\n",
      " 0.00196292 0.00201972 0.00195468 0.00201558 0.00196426 0.00198555\n",
      " 0.00200398 0.00190703 0.00200187 0.00200971 0.00194899 0.00202898\n",
      " 0.00197917 0.00209215 0.00198985 0.00205729 0.00198844 0.00199928\n",
      " 0.00198518 0.00197327 0.00191785 0.00201099 0.00201094 0.0019727\n",
      " 0.00199293 0.00198637 0.00200558 0.00201019 0.0019307  0.00200749\n",
      " 0.00201239 0.00198582 0.00202104 0.00199491 0.00198007 0.00199715\n",
      " 0.00200537 0.00199523 0.00198211 0.00195221 0.00200065 0.00198807\n",
      " 0.00201237 0.00199494 0.00200134 0.00193596 0.00201636 0.00201031\n",
      " 0.00208228 0.0019927  0.00204967 0.00202298 0.00203205 0.00199821\n",
      " 0.00197277 0.00203741 0.00200598 0.00202783 0.00196135 0.00195549\n",
      " 0.00198962 0.00198795 0.00198914 0.00197828 0.00203962 0.0020313\n",
      " 0.00201079 0.00220239 0.0019852  0.0019598  0.00194912 0.00199592\n",
      " 0.0019795  0.00201274 0.00202878 0.00199811 0.00196178 0.00196477\n",
      " 0.00197902 0.00199978 0.00200562 0.00195567 0.00201796 0.00201743\n",
      " 0.00200234 0.00199115 0.00210799 0.00202893 0.00201884 0.00194838\n",
      " 0.00201896 0.00200513 0.00202769 0.00198933 0.00196887 0.00202204\n",
      " 0.00199878 0.00199898 0.00199928 0.00206186 0.00198735 0.00203272\n",
      " 0.00210397 0.00198648 0.00200015 0.00199458 0.00196278 0.00198959\n",
      " 0.0019911  0.00195721 0.00193213 0.00205547 0.00199488 0.00214626\n",
      " 0.00196581 0.00195746 0.00203177 0.00200056 0.00203983 0.00199974\n",
      " 0.00201677 0.00196645 0.00197344 0.00202446 0.00200872 0.001987\n",
      " 0.00196255 0.00199824 0.00202547 0.00203698 0.00206221 0.00201642\n",
      " 0.00200834 0.00199087 0.00200776 0.00201245 0.00199761 0.00204901\n",
      " 0.0019911  0.00192026 0.0020053  0.00199846 0.00201322 0.00198254\n",
      " 0.00205498 0.00199854 0.0019417  0.00200391 0.00200299 0.0020373\n",
      " 0.00201929 0.00201105 0.00204216 0.00203168 0.00200765 0.00201762\n",
      " 0.00197529 0.00198238 0.00203386 0.00189243 0.00205976 0.00208382\n",
      " 0.00200354 0.00199867 0.00197023 0.00204328 0.00198249 0.00196895\n",
      " 0.00197807 0.00203813 0.00189559 0.00203133 0.00197081 0.00212833\n",
      " 0.00200048 0.0020076  0.00196043 0.00199827 0.00198398 0.00198363\n",
      " 0.00195058 0.00207727 0.00212893 0.0019927  0.00197639 0.00199836\n",
      " 0.0019232  0.00196776 0.00200621 0.00202396 0.00197685 0.00203129\n",
      " 0.00199303 0.00191818 0.00199928 0.00203677 0.00200228 0.00203535\n",
      " 0.00197048 0.00200222 0.0019366  0.00197876 0.00199037 0.0019986\n",
      " 0.0020405  0.00200646 0.00198023 0.00200284 0.00201889 0.00199229\n",
      " 0.00211526 0.00201636 0.00202153 0.00198971 0.00197897 0.00202832\n",
      " 0.00199165 0.00199675 0.00197669 0.00199928 0.00198548 0.00200736\n",
      " 0.00200618 0.00205687 0.00197431 0.00198781 0.00198711 0.00192697\n",
      " 0.00198095 0.00200213 0.00199987 0.00198974 0.00196437 0.00192419\n",
      " 0.00194946 0.00206924 0.00200976 0.00198567 0.00204098 0.00199525\n",
      " 0.00196487 0.00200331 0.00203857 0.00199752 0.0020433  0.00202269\n",
      " 0.0019889  0.00200519 0.00199077 0.0020092  0.00198828 0.0020296\n",
      " 0.00198756 0.00201276 0.00187982 0.00202527 0.00201601 0.00202684\n",
      " 0.00201057 0.00201215 0.00200067 0.00199928 0.00201666 0.00204184\n",
      " 0.002008   0.00195388 0.00198507 0.00196967 0.00207376 0.00214283\n",
      " 0.00200651 0.00200007 0.00208092 0.00198838 0.00207471 0.00200144\n",
      " 0.00202426 0.00201242 0.00205732 0.00199928 0.00197838 0.00204215\n",
      " 0.00193587 0.00194289 0.00196679 0.00202083 0.00197979 0.00202515\n",
      " 0.00198365 0.00198444 0.00196106 0.00198973 0.00202724 0.00201692\n",
      " 0.00199215 0.0019628  0.00194855 0.00200586 0.00201462 0.00198379\n",
      " 0.00199016 0.00197845 0.00205697 0.00200372 0.0019553  0.00199602\n",
      " 0.0020163  0.00198397 0.00198294 0.00193749 0.00196668 0.00199783\n",
      " 0.00198305 0.00199615 0.00201595 0.00198389 0.00198397 0.00198466\n",
      " 0.00199928 0.0020015  0.00197949 0.00217992 0.0019801  0.00190358\n",
      " 0.00200206 0.00199729 0.00200832 0.00201918 0.00206361 0.00199361\n",
      " 0.00199372 0.00197599]\n",
      "2010-02-10 00:00:00\n",
      "72 500\n",
      "(72, 500, 3) (72, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00248225 0.00198612 0.0014315  0.0022481  0.00205017 0.00194608\n",
      " 0.00211529 0.00191211 0.00201588 0.00195809 0.00171159 0.00191912\n",
      " 0.00195106 0.0016679  0.00194761 0.00201408 0.00216178 0.00201118\n",
      " 0.00199236 0.00190106 0.00208956 0.00199877 0.00231766 0.00190595\n",
      " 0.00206832 0.00245254 0.0018354  0.00208996 0.00197456 0.00245285\n",
      " 0.00214758 0.00200472 0.00205225 0.00229347 0.00206504 0.00192443\n",
      " 0.00212051 0.0019137  0.00194841 0.00167091 0.00184782 0.00215194\n",
      " 0.00207266 0.00182824 0.00187541 0.00197076 0.00210744 0.00249201\n",
      " 0.00202652 0.00182575 0.0023058  0.00188945 0.00162008 0.00174265\n",
      " 0.00205718 0.00188305 0.00181829 0.00201875 0.00196704 0.0020058\n",
      " 0.00192404 0.00190563 0.00153069 0.00195082 0.00175536 0.00205142\n",
      " 0.00210905 0.00209783 0.00181821 0.00210739 0.00185629 0.00170291\n",
      " 0.00212412 0.00148481 0.00203974 0.00200406 0.0022172  0.00233853\n",
      " 0.00203922 0.00210905 0.00208381 0.00201974 0.00213026 0.00213434\n",
      " 0.00226668 0.00136534 0.00209725 0.00196983 0.00219437 0.00208213\n",
      " 0.00208323 0.00188334 0.00210056 0.00201072 0.00205628 0.0021052\n",
      " 0.00204457 0.00178587 0.00203151 0.00209683 0.00181933 0.00197709\n",
      " 0.00208529 0.00175751 0.00191945 0.00171514 0.00184911 0.00192613\n",
      " 0.00201542 0.00182562 0.00198915 0.00213171 0.00208092 0.00205901\n",
      " 0.00186962 0.00210376 0.002098   0.00206123 0.00203841 0.00183302\n",
      " 0.00200455 0.00208291 0.00168543 0.00205605 0.00195048 0.0021805\n",
      " 0.00192868 0.00150489 0.00152052 0.00189271 0.00189887 0.00162099\n",
      " 0.00200758 0.00202212 0.00185907 0.00206682 0.00199435 0.00204724\n",
      " 0.00205799 0.00220032 0.00207054 0.00204132 0.00191575 0.00195506\n",
      " 0.00213115 0.00207266 0.00173969 0.00206076 0.00195209 0.00186941\n",
      " 0.00198745 0.00177021 0.0019768  0.00176166 0.00196141 0.00252886\n",
      " 0.00206305 0.00208291 0.00211299 0.0017388  0.00120835 0.00187804\n",
      " 0.00198022 0.00204093 0.0019404  0.00196912 0.00221074 0.002019\n",
      " 0.00152747 0.00201296 0.00213168 0.00203428 0.00210381 0.00222786\n",
      " 0.00191647 0.00231961 0.00183201 0.00174284 0.00199067 0.00188938\n",
      " 0.00205746 0.00171146 0.0022125  0.00158755 0.00213466 0.00210118\n",
      " 0.00211487 0.00216585 0.00248685 0.0021287  0.00203602 0.00214044\n",
      " 0.00210375 0.00208694 0.00201145 0.0020733  0.00216466 0.00187307\n",
      " 0.00167262 0.00203153 0.00219231 0.00201545 0.00199533 0.00205123\n",
      " 0.00208738 0.00206913 0.00196451 0.00221292 0.00212535 0.00187352\n",
      " 0.00187207 0.00178852 0.00191033 0.00211996 0.00175644 0.00203191\n",
      " 0.00160729 0.00204066 0.00195748 0.00208477 0.00212051 0.00215017\n",
      " 0.00195733 0.00204303 0.00204209 0.00182392 0.00232454 0.00194473\n",
      " 0.00233935 0.00193897 0.00192222 0.00209982 0.00207827 0.00214738\n",
      " 0.00208504 0.00242335 0.00199807 0.00176815 0.00209618 0.00207301\n",
      " 0.00212331 0.00179814 0.00195214 0.00204248 0.00199159 0.00206298\n",
      " 0.00207965 0.00204617 0.00219427 0.00208587 0.00175444 0.0020285\n",
      " 0.00195582 0.00204649 0.00231647 0.00210725 0.00221963 0.00195468\n",
      " 0.00215834 0.00181809 0.00213092 0.00146334 0.00209211 0.00200198\n",
      " 0.00212929 0.00206281 0.00210118 0.00240858 0.001754   0.00213231\n",
      " 0.00196335 0.00197686 0.00160765 0.00198286 0.00207553 0.00230797\n",
      " 0.00187336 0.00205407 0.00191771 0.00181702 0.00203846 0.00214584\n",
      " 0.00212706 0.00192447 0.00211102 0.00188133 0.00229426 0.00187484\n",
      " 0.00203381 0.00205893 0.00191092 0.00196752 0.0021399  0.00194324\n",
      " 0.00172391 0.00209451 0.00196163 0.00214371 0.00202029 0.00195942\n",
      " 0.0020961  0.00200037 0.00210118 0.00203803 0.00202534 0.00199724\n",
      " 0.00190569 0.00214362 0.00211928 0.0019385  0.00200776 0.00222217\n",
      " 0.00182252 0.00209034 0.00227951 0.00202906 0.00201363 0.00196385\n",
      " 0.00180942 0.00209673 0.00206687 0.00203191 0.00177573 0.0018498\n",
      " 0.00211797 0.00212809 0.00191493 0.00204737 0.00179433 0.00214716\n",
      " 0.00210114 0.00211964 0.00187821 0.00208508 0.00193084 0.00237904\n",
      " 0.00219275 0.002075   0.00244715 0.00194703 0.0017463  0.00192682\n",
      " 0.00197189 0.00195206 0.00161039 0.00211208 0.00198595 0.00197273\n",
      " 0.0020266  0.00208433 0.00213948 0.00214383 0.00184295 0.00167852\n",
      " 0.00182154 0.00215837 0.0018861  0.00212965 0.00202325 0.00196334\n",
      " 0.00217029 0.00192491 0.00212693 0.0017508  0.00205611 0.00197665\n",
      " 0.00203553 0.00232454 0.00186633 0.00198736 0.00192164 0.00183296\n",
      " 0.00193094 0.00171156 0.00215499 0.00218909 0.00188207 0.00224293\n",
      " 0.00226021 0.00197183 0.00195306 0.00176428 0.00189283 0.00174287\n",
      " 0.00194052 0.0020812  0.00187659 0.00210118 0.00207239 0.0019401\n",
      " 0.00182142 0.00204414 0.00213981 0.00203307 0.0023646  0.00200262\n",
      " 0.00208518 0.00197562 0.00210295 0.00200549 0.00197406 0.00192264\n",
      " 0.00205229 0.0013538  0.0020716  0.00206263 0.0019251  0.00171798\n",
      " 0.00261187 0.00201833 0.00197466 0.00209854 0.00199067 0.00202912\n",
      " 0.00272362 0.00247641 0.00215925 0.00210118 0.00196285 0.00225589\n",
      " 0.00203143 0.00178548 0.00239844 0.00196728 0.00166281 0.00201255\n",
      " 0.00205183 0.00194685 0.00207376 0.00214265 0.00185174 0.00210778\n",
      " 0.00187021 0.00210555 0.00196682 0.00202266 0.00210199 0.00211567\n",
      " 0.00194525 0.00193438 0.00135881 0.00210243 0.00180073 0.00221105\n",
      " 0.00195258 0.0020102  0.00202702 0.00213751 0.00214021 0.00171055\n",
      " 0.00225165 0.00238104 0.00185114 0.00185492 0.002051   0.00169865\n",
      " 0.00184527 0.00204994 0.0020233  0.00205188 0.00177734 0.00199858\n",
      " 0.00215065 0.00180854 0.00215591 0.00180042 0.00182541 0.00190285\n",
      " 0.00199094 0.00202389 0.00180172 0.0020072  0.00182406 0.00194067\n",
      " 0.0019382  0.00209244 0.00214191 0.00213506 0.0020757  0.00199545\n",
      " 0.00210083 0.00199253 0.00199757 0.0017959  0.00202365 0.00196896\n",
      " 0.00213185 0.00206648 0.00195567 0.00209802 0.00200298 0.0016675\n",
      " 0.00173573 0.00184911 0.00186813 0.00185119 0.00195803 0.00197317\n",
      " 0.00189483 0.00198717]\n",
      "2010-02-11 00:00:00\n",
      "72 500\n",
      "(72, 500, 3) (72, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00137887 0.00193401 0.00181448 0.00160379 0.00200882 0.00213774\n",
      " 0.00144834 0.00206662 0.00375402 0.00204367 0.00232246 0.00162579\n",
      " 0.00213439 0.00215382 0.00199401 0.0018971  0.00160697 0.00166528\n",
      " 0.00164106 0.0026665  0.00242072 0.00175451 0.0018328  0.00168613\n",
      " 0.00173545 0.00144453 0.00195486 0.00184781 0.00181647 0.00205409\n",
      " 0.00190183 0.00168187 0.00196608 0.00261853 0.00188737 0.00229632\n",
      " 0.00139204 0.00302801 0.00178385 0.00178914 0.00176661 0.00193353\n",
      " 0.00176889 0.00194707 0.00148673 0.00193691 0.00180628 0.00196608\n",
      " 0.00175453 0.00166681 0.0015086  0.00171004 0.00181896 0.00210155\n",
      " 0.0016448  0.00191787 0.0019105  0.00155685 0.00176873 0.00179019\n",
      " 0.00213532 0.00185716 0.00210662 0.00199876 0.00441912 0.00178821\n",
      " 0.00215383 0.00162505 0.00193433 0.0015046  0.00180468 0.00189397\n",
      " 0.00201058 0.00190166 0.00204979 0.00218938 0.00118597 0.0017043\n",
      " 0.00191539 0.00180458 0.00164749 0.00227059 0.00183696 0.00169373\n",
      " 0.00194359 0.00131877 0.00194713 0.00193856 0.00392622 0.0017227\n",
      " 0.0016196  0.00160674 0.00137242 0.00204524 0.00159917 0.00163312\n",
      " 0.00161591 0.00155732 0.00176291 0.00154942 0.00170308 0.00177772\n",
      " 0.002046   0.00215326 0.00196573 0.00186132 0.00193624 0.00228446\n",
      " 0.00181154 0.00226207 0.00416919 0.00240972 0.00237785 0.00190861\n",
      " 0.00175776 0.00199206 0.001717   0.00185713 0.00189526 0.00168804\n",
      " 0.00185307 0.00206808 0.00196608 0.00208756 0.00209097 0.00163737\n",
      " 0.00224458 0.00170148 0.00163233 0.0018466  0.00194448 0.00218628\n",
      " 0.0022196  0.00227425 0.00166315 0.00182565 0.0018159  0.00187007\n",
      " 0.00204103 0.00176888 0.00200642 0.001831   0.00208698 0.00194453\n",
      " 0.002031   0.00260498 0.00215178 0.00162048 0.00249275 0.00167577\n",
      " 0.00210796 0.00270219 0.00317597 0.00165525 0.00198757 0.00190743\n",
      " 0.00207395 0.00210022 0.00218165 0.00210557 0.00167204 0.00186583\n",
      " 0.00196541 0.00178648 0.00237957 0.00213034 0.00460779 0.00150517\n",
      " 0.00202378 0.00201038 0.00178958 0.00225587 0.0017736  0.00174442\n",
      " 0.00160634 0.00181007 0.00187533 0.00332727 0.00188135 0.0028466\n",
      " 0.00193503 0.00165082 0.00186744 0.00171483 0.00194222 0.00196608\n",
      " 0.00189709 0.00161081 0.00168489 0.00186217 0.0020416  0.00184837\n",
      " 0.0017039  0.0015907  0.00179379 0.00191877 0.00168285 0.00323316\n",
      " 0.00155303 0.00221115 0.00174578 0.00191351 0.00165201 0.00203975\n",
      " 0.00160222 0.00186462 0.00175359 0.00155818 0.00154974 0.00178263\n",
      " 0.00184827 0.00327442 0.00199019 0.001069   0.00159472 0.00199585\n",
      " 0.00161744 0.00164866 0.00301417 0.00159732 0.00219304 0.0019821\n",
      " 0.00175241 0.00183276 0.00194035 0.0029375  0.00159027 0.00201665\n",
      " 0.00151867 0.00282835 0.00179259 0.0015937  0.00200585 0.0019606\n",
      " 0.00180078 0.00198908 0.00166953 0.00189745 0.00175469 0.00186198\n",
      " 0.00176997 0.00162196 0.0017722  0.00208079 0.00210802 0.00162557\n",
      " 0.00184634 0.00198889 0.00148199 0.00180523 0.00182396 0.00217037\n",
      " 0.00179736 0.00213038 0.00137758 0.00244807 0.0014772  0.00169984\n",
      " 0.00149734 0.00217853 0.00171793 0.00131994 0.00184362 0.00154182\n",
      " 0.00167411 0.00333419 0.00196608 0.00184134 0.00203137 0.00225921\n",
      " 0.00190212 0.00215775 0.00227098 0.00165856 0.00220212 0.00198633\n",
      " 0.00175745 0.00145806 0.0032592  0.00158858 0.00216977 0.00182924\n",
      " 0.00198898 0.00178865 0.00269593 0.00306741 0.00163884 0.00237751\n",
      " 0.00220016 0.00251635 0.00177952 0.00171122 0.00164699 0.00191463\n",
      " 0.00201786 0.00178218 0.0019373  0.00455358 0.00196145 0.00213545\n",
      " 0.00221514 0.0018542  0.00195732 0.00199902 0.00188482 0.00186854\n",
      " 0.00215783 0.00142073 0.00218215 0.00259082 0.00206272 0.00173418\n",
      " 0.00181799 0.00166388 0.00143142 0.00202432 0.00174884 0.00212589\n",
      " 0.00361797 0.00185774 0.00163521 0.0020353  0.00211299 0.00170965\n",
      " 0.00196295 0.00169967 0.00168941 0.00158279 0.00166247 0.00188046\n",
      " 0.00269887 0.00189113 0.00193739 0.00180119 0.00252762 0.00159602\n",
      " 0.0020085  0.00151292 0.00171601 0.00245806 0.00402672 0.0042513\n",
      " 0.00278749 0.0019446  0.00139772 0.00190363 0.00233967 0.00174749\n",
      " 0.00199741 0.00168047 0.00159337 0.00187983 0.00216422 0.0017764\n",
      " 0.00150915 0.00172021 0.00397281 0.00214719 0.00191234 0.00207596\n",
      " 0.00180607 0.00203163 0.00186481 0.00232473 0.00207198 0.00217985\n",
      " 0.00167803 0.00157328 0.00178719 0.00244485 0.00225635 0.00179585\n",
      " 0.00168837 0.00196333 0.00171406 0.00227774 0.00206739 0.00126177\n",
      " 0.00182738 0.00292246 0.0031674  0.00191103 0.00197519 0.0018004\n",
      " 0.00198893 0.00181901 0.00167253 0.00196608 0.0018111  0.00225044\n",
      " 0.0019663  0.00176873 0.00208521 0.00198602 0.00157963 0.0028001\n",
      " 0.00232739 0.00187141 0.00273035 0.00167543 0.00170488 0.00234361\n",
      " 0.0019064  0.00203575 0.00189411 0.00207914 0.00159586 0.00143475\n",
      " 0.00168469 0.00176774 0.00257076 0.00180223 0.00208736 0.00179328\n",
      " 0.00149989 0.00173755 0.00176397 0.00196512 0.00215035 0.00252223\n",
      " 0.00173335 0.00161344 0.00172717 0.00210925 0.00224437 0.00142476\n",
      " 0.00179331 0.00175482 0.00186432 0.00173052 0.00172974 0.00164989\n",
      " 0.00230367 0.00204356 0.00189655 0.00208207 0.00196608 0.00166773\n",
      " 0.00179304 0.00160509 0.00155916 0.00193633 0.00188057 0.00162065\n",
      " 0.00172675 0.00180765 0.00173251 0.0015171  0.00289132 0.00196582\n",
      " 0.00221684 0.00151877 0.01278859 0.00200227 0.00167371 0.00173204\n",
      " 0.00181142 0.00188864 0.00200001 0.00198976 0.00169922 0.00214556\n",
      " 0.00311659 0.00198579 0.00186124 0.00175889 0.00203136 0.0016386\n",
      " 0.0029751  0.00179278 0.00242345 0.00220981 0.00308566 0.00185086\n",
      " 0.0019396  0.00182897 0.00155699 0.00243303 0.00196431 0.00168365\n",
      " 0.0021651  0.00228025 0.00176277 0.00172691 0.00206982 0.00175603\n",
      " 0.00161785 0.00219093 0.00183828 0.00183507 0.00221374 0.00232389\n",
      " 0.00188639 0.00294083 0.00193259 0.00194679 0.00191619 0.00214926\n",
      " 0.00177672 0.00182572]\n",
      "2010-02-12 00:00:00\n",
      "72 500\n",
      "(72, 500, 3) (72, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00196631 0.00218383 0.00212892 0.00195864 0.00182701 0.00209215\n",
      " 0.00169589 0.00192408 0.00223764 0.00191564 0.00210821 0.00195851\n",
      " 0.00210333 0.00215105 0.00202475 0.0020084  0.00197117 0.00203116\n",
      " 0.00190766 0.00234061 0.00201687 0.00206853 0.00195418 0.00219622\n",
      " 0.00205983 0.00198832 0.00182152 0.00192166 0.00202361 0.00207541\n",
      " 0.00209519 0.00186871 0.00216039 0.00209222 0.00211892 0.00191542\n",
      " 0.00186771 0.00207797 0.00205745 0.00187212 0.00205286 0.00209293\n",
      " 0.00191311 0.00205523 0.00213674 0.00201986 0.00200932 0.00215402\n",
      " 0.00202094 0.00202034 0.00214772 0.0020218  0.00138307 0.0021403\n",
      " 0.00215351 0.00209829 0.0022734  0.00192703 0.00204624 0.00188919\n",
      " 0.00217895 0.00195185 0.00197725 0.00211213 0.00224007 0.00217636\n",
      " 0.00214746 0.002081   0.00210026 0.0021364  0.00196209 0.00193649\n",
      " 0.00215559 0.00194817 0.00213088 0.00201323 0.00193294 0.00184307\n",
      " 0.00201846 0.00195167 0.00189441 0.00192171 0.00216645 0.00201301\n",
      " 0.00230867 0.0020835  0.00202364 0.00208534 0.002683   0.00206639\n",
      " 0.00225004 0.00210962 0.00170574 0.00185781 0.00195254 0.00165953\n",
      " 0.0020963  0.00210392 0.00196168 0.00189385 0.00205704 0.00213944\n",
      " 0.0016363  0.00203729 0.0020564  0.00204483 0.00198131 0.00241965\n",
      " 0.00189142 0.00204539 0.00203689 0.00216252 0.00206036 0.00216468\n",
      " 0.00202693 0.00208583 0.00200156 0.00239277 0.00208339 0.00155262\n",
      " 0.00196343 0.00193616 0.00218151 0.00206213 0.00177824 0.00196045\n",
      " 0.00200011 0.00188518 0.00208569 0.00208781 0.00187404 0.00191163\n",
      " 0.00200639 0.00190902 0.00158408 0.00215272 0.00205578 0.00188229\n",
      " 0.00184872 0.00218816 0.0019785  0.00216162 0.00209059 0.00217528\n",
      " 0.00194475 0.00199779 0.00192747 0.00203738 0.00203597 0.00205442\n",
      " 0.00182752 0.00201173 0.00210891 0.00197076 0.00206505 0.00183837\n",
      " 0.00196128 0.00218932 0.00218311 0.00192526 0.00204623 0.00188395\n",
      " 0.00213753 0.00202113 0.00183264 0.00204944 0.00239413 0.00187322\n",
      " 0.00188903 0.00203536 0.00204513 0.00218015 0.00201446 0.00211997\n",
      " 0.00206713 0.00207294 0.0017499  0.0021167  0.00164451 0.00214829\n",
      " 0.00204389 0.0019347  0.0016928  0.00217856 0.00203843 0.00213311\n",
      " 0.00208143 0.00205529 0.00197947 0.00204839 0.00210112 0.0020783\n",
      " 0.00198485 0.00128828 0.00201835 0.00208548 0.00207984 0.00218707\n",
      " 0.00201177 0.00201889 0.00164816 0.00211238 0.00211616 0.00201157\n",
      " 0.00179543 0.00213744 0.00196208 0.00175993 0.0018282  0.00201092\n",
      " 0.00183227 0.00123202 0.00200779 0.00184329 0.00169047 0.00216064\n",
      " 0.00167654 0.00179538 0.00170217 0.00181384 0.00179778 0.00165875\n",
      " 0.00204838 0.00163095 0.00199134 0.00190932 0.00210519 0.00209591\n",
      " 0.00195544 0.00220258 0.00185263 0.0020501  0.00190838 0.00189516\n",
      " 0.00171381 0.00136194 0.00205317 0.00196873 0.0020314  0.00203044\n",
      " 0.00204523 0.00208908 0.00201712 0.00210968 0.00184223 0.00194892\n",
      " 0.00213114 0.00180687 0.00203259 0.00205347 0.00194363 0.00196196\n",
      " 0.00200302 0.00203304 0.00202532 0.00207347 0.00172605 0.00196473\n",
      " 0.00165407 0.00213726 0.00169783 0.00205007 0.00201612 0.00144529\n",
      " 0.0018817  0.00189216 0.00213311 0.0019565  0.00210643 0.00202756\n",
      " 0.00208255 0.00191676 0.00237465 0.00194298 0.00214382 0.00175485\n",
      " 0.00174459 0.00214545 0.00214768 0.00194321 0.00220413 0.00197304\n",
      " 0.00207763 0.00202883 0.00215351 0.00194115 0.00209112 0.00209677\n",
      " 0.00163222 0.00213016 0.00186248 0.0021     0.00228809 0.00206305\n",
      " 0.00214094 0.00196961 0.00244195 0.00203358 0.00206991 0.00214681\n",
      " 0.00182922 0.0020241  0.00202938 0.00210484 0.00204869 0.00201743\n",
      " 0.0019636  0.00186993 0.00210336 0.00212179 0.00178645 0.0017684\n",
      " 0.00199849 0.00200794 0.00213853 0.00193394 0.00185349 0.00215129\n",
      " 0.00229489 0.00205955 0.00153243 0.00208727 0.00222376 0.0019313\n",
      " 0.00208995 0.00163226 0.00192215 0.00211186 0.00201158 0.00193572\n",
      " 0.00212706 0.00212157 0.00196316 0.00205631 0.00198367 0.00184845\n",
      " 0.00215537 0.00180227 0.00190379 0.00214305 0.00190203 0.00215767\n",
      " 0.00221243 0.00183625 0.00201606 0.00192653 0.00198929 0.0020846\n",
      " 0.00206217 0.00183874 0.00173465 0.00212431 0.00222993 0.00175657\n",
      " 0.0016234  0.00214099 0.00217859 0.00213368 0.00196364 0.00209847\n",
      " 0.00213852 0.00208234 0.00210207 0.00216468 0.00212073 0.00199143\n",
      " 0.00210983 0.00210429 0.00168534 0.00221611 0.00213966 0.00197397\n",
      " 0.00193899 0.00202512 0.0020881  0.00214461 0.0019861  0.00205964\n",
      " 0.00195574 0.00199246 0.00215058 0.00216152 0.00171003 0.00198241\n",
      " 0.00201011 0.00188678 0.00186813 0.00213311 0.00202276 0.00210471\n",
      " 0.00195586 0.00190726 0.00191485 0.00203752 0.00225926 0.00229586\n",
      " 0.00220088 0.00204908 0.00213788 0.00204423 0.0017366  0.00185188\n",
      " 0.00203323 0.00200426 0.00204854 0.00200921 0.00192023 0.00319207\n",
      " 0.00207024 0.00211528 0.00208309 0.00209839 0.00192294 0.00205102\n",
      " 0.00195705 0.00123303 0.00193191 0.00215879 0.0019129  0.00205266\n",
      " 0.00203703 0.0021146  0.00206255 0.00207289 0.00184181 0.00214549\n",
      " 0.0020792  0.00207188 0.00200434 0.00165316 0.0020326  0.00196404\n",
      " 0.00216258 0.00203361 0.00197065 0.00199202 0.00216059 0.001619\n",
      " 0.00199572 0.00206409 0.00187081 0.00171563 0.00207407 0.00204847\n",
      " 0.00198177 0.00190806 0.00186426 0.00197294 0.00221076 0.00211691\n",
      " 0.00180128 0.00205926 0.00174185 0.00158067 0.00183586 0.0018948\n",
      " 0.00178819 0.0020848  0.00189794 0.00206054 0.00173006 0.00189771\n",
      " 0.00186739 0.00205526 0.0019818  0.00204781 0.0016128  0.00191538\n",
      " 0.0018018  0.00200012 0.00190156 0.00209329 0.00223706 0.00209572\n",
      " 0.00187299 0.00193566 0.00204276 0.00228016 0.00185113 0.00179989\n",
      " 0.00222754 0.00183999 0.00212992 0.00198801 0.00205458 0.00204787\n",
      " 0.00212707 0.00210441 0.00209578 0.00194596 0.00190745 0.00195456\n",
      " 0.00209987 0.00201646 0.00195909 0.00192501 0.00211729 0.00210278\n",
      " 0.00184213 0.00187599]\n",
      "2010-02-22 00:00:00\n",
      "65 500\n",
      "(65, 500, 3) (65, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00186195 0.00204987 0.00189716 0.00187448 0.00201283 0.00200717\n",
      " 0.00200317 0.00198761 0.00208095 0.00206064 0.00202831 0.00180575\n",
      " 0.00204356 0.00201034 0.00197872 0.00204459 0.00197963 0.00199123\n",
      " 0.00168447 0.00191712 0.00200093 0.00197677 0.0019952  0.00203302\n",
      " 0.00187311 0.00184065 0.00219628 0.00200408 0.00202018 0.00196253\n",
      " 0.00200375 0.00198878 0.00215088 0.00194235 0.00198099 0.00201134\n",
      " 0.00205266 0.00197075 0.00200841 0.00215106 0.00205957 0.00200408\n",
      " 0.00180552 0.00201658 0.00200125 0.00202039 0.0020105  0.00184006\n",
      " 0.00196165 0.00196337 0.002004   0.00202774 0.0020131  0.00202822\n",
      " 0.00191849 0.00200797 0.00197499 0.00192427 0.00199085 0.00197258\n",
      " 0.00202753 0.00199158 0.00205367 0.00201943 0.00211756 0.00200965\n",
      " 0.00206909 0.00196593 0.00202152 0.002023   0.00203029 0.00188693\n",
      " 0.00198751 0.00204207 0.00199164 0.00198505 0.00170349 0.00197016\n",
      " 0.00202215 0.00198545 0.00215597 0.00168489 0.00203736 0.00198034\n",
      " 0.00193371 0.00203363 0.00200848 0.00199569 0.00211831 0.00201312\n",
      " 0.00196466 0.00199799 0.00184219 0.00209442 0.00194609 0.0020226\n",
      " 0.00206983 0.00205382 0.00183367 0.00190186 0.00200201 0.00199331\n",
      " 0.00182893 0.00207275 0.00202922 0.00207373 0.00204554 0.0020103\n",
      " 0.00196793 0.0020668  0.00209248 0.00203596 0.00197159 0.0018611\n",
      " 0.00198191 0.00204298 0.00182274 0.00208041 0.00197637 0.00209165\n",
      " 0.00203442 0.00205751 0.00212753 0.00202966 0.00203989 0.00216844\n",
      " 0.00196994 0.00183758 0.00200408 0.00196293 0.00199917 0.00204748\n",
      " 0.00207003 0.00205005 0.00195272 0.00196708 0.00197541 0.00204738\n",
      " 0.00192908 0.00194218 0.00200029 0.00208539 0.00193499 0.00206166\n",
      " 0.00199789 0.00207101 0.00212319 0.00192203 0.00205734 0.00196144\n",
      " 0.00202072 0.00198348 0.00203078 0.00198508 0.00187174 0.00192811\n",
      " 0.00187622 0.00192092 0.00198397 0.00209035 0.0020064  0.0020311\n",
      " 0.00196543 0.00201172 0.00207436 0.0020416  0.00203887 0.00179003\n",
      " 0.00206778 0.0019569  0.00205326 0.00197598 0.00195242 0.00193389\n",
      " 0.00194373 0.0020221  0.00203617 0.00197125 0.00205323 0.00200272\n",
      " 0.00201589 0.00196536 0.00196466 0.0020469  0.00204898 0.00200408\n",
      " 0.00203263 0.00198684 0.00199547 0.0020257  0.00197393 0.0019997\n",
      " 0.00197053 0.00201571 0.0020477  0.00201026 0.00201713 0.00201413\n",
      " 0.0020013  0.00207216 0.00199706 0.00206441 0.00198526 0.00202623\n",
      " 0.00202398 0.00205397 0.00198401 0.0019152  0.00199457 0.00199773\n",
      " 0.00209353 0.00207468 0.00195488 0.00188921 0.00197998 0.00211014\n",
      " 0.00203532 0.00213273 0.00204992 0.00201627 0.00201744 0.00202863\n",
      " 0.00195194 0.00184589 0.00205107 0.00206338 0.00201976 0.00197934\n",
      " 0.00191912 0.00196865 0.00201983 0.00197114 0.00204749 0.00204903\n",
      " 0.00200248 0.00211231 0.00196643 0.00186755 0.00196989 0.00204242\n",
      " 0.00195939 0.0020254  0.00200737 0.00202373 0.00200859 0.00204964\n",
      " 0.001764   0.00201183 0.00168543 0.00213496 0.00204485 0.00206234\n",
      " 0.00200972 0.00188393 0.00185274 0.00206341 0.00202347 0.00202941\n",
      " 0.00201736 0.00200816 0.00201389 0.002011   0.00204746 0.00205467\n",
      " 0.00209526 0.00205994 0.00200408 0.00179023 0.00199897 0.00201697\n",
      " 0.00198323 0.00196735 0.00197684 0.0019642  0.00195444 0.00193777\n",
      " 0.00207583 0.00194781 0.00195072 0.00180204 0.00204113 0.00209363\n",
      " 0.00183807 0.00196033 0.00209762 0.00206647 0.00197628 0.00204019\n",
      " 0.0020641  0.00209246 0.00199459 0.00196618 0.00196622 0.00195322\n",
      " 0.00206356 0.00202242 0.00203086 0.00209722 0.00203933 0.00206521\n",
      " 0.00205055 0.00204546 0.00189334 0.00201471 0.00198899 0.00204701\n",
      " 0.00209475 0.00202691 0.00201997 0.00210661 0.00186351 0.00207096\n",
      " 0.0019981  0.00199604 0.00189322 0.0019916  0.00207964 0.00193618\n",
      " 0.00209902 0.00203619 0.00202861 0.00196195 0.00215423 0.00199529\n",
      " 0.00200812 0.00201057 0.00202367 0.00196728 0.00199155 0.00197817\n",
      " 0.00208091 0.00194908 0.00200876 0.00205205 0.00206464 0.00183946\n",
      " 0.00197871 0.00202643 0.0020282  0.00204621 0.00204607 0.00219038\n",
      " 0.00211441 0.00199894 0.00205495 0.0020045  0.00207609 0.00200289\n",
      " 0.00196673 0.00205895 0.00200416 0.00199847 0.00209295 0.0019941\n",
      " 0.00198521 0.00197213 0.0020649  0.0019281  0.00199769 0.00201537\n",
      " 0.0019809  0.00202144 0.00190908 0.00206296 0.0020049  0.00208447\n",
      " 0.00200603 0.00196316 0.0019485  0.00198887 0.00202606 0.00200948\n",
      " 0.0020178  0.00208232 0.00201408 0.0020264  0.00207769 0.00169038\n",
      " 0.00200427 0.0020364  0.0019874  0.00201828 0.00190929 0.00200136\n",
      " 0.0020029  0.00196738 0.00205432 0.00200408 0.0019449  0.00201171\n",
      " 0.00200494 0.00197745 0.00194267 0.00190511 0.00193378 0.00193918\n",
      " 0.00204873 0.00199693 0.0020817  0.00200808 0.00202027 0.00204166\n",
      " 0.00200954 0.00200567 0.00195033 0.00203593 0.00190944 0.00194823\n",
      " 0.00204775 0.00202274 0.00198907 0.0019825  0.00189834 0.00200608\n",
      " 0.00198091 0.0021794  0.00190103 0.00203872 0.00200151 0.00171727\n",
      " 0.00197203 0.00209792 0.00199702 0.00200293 0.00207908 0.00196864\n",
      " 0.00199327 0.00196838 0.00194646 0.00205459 0.00199518 0.00196622\n",
      " 0.0019507  0.00203821 0.00209236 0.00202583 0.00189353 0.00199863\n",
      " 0.00203497 0.00200021 0.0020476  0.00199377 0.00201533 0.00209311\n",
      " 0.00202108 0.00223653 0.00196986 0.0018351  0.00194853 0.00211081\n",
      " 0.00197868 0.00193062 0.00198159 0.00194359 0.00195837 0.00199568\n",
      " 0.00203964 0.00202255 0.00197605 0.00200898 0.00199848 0.00204483\n",
      " 0.00189967 0.00204925 0.00199559 0.00188374 0.00192413 0.00199313\n",
      " 0.0019092  0.00204887 0.00197725 0.00199369 0.00209748 0.00199708\n",
      " 0.0019998  0.00198321 0.00202951 0.00211248 0.00204665 0.00200408\n",
      " 0.00205607 0.00206303 0.00204525 0.00204252 0.00199612 0.00206615\n",
      " 0.00186666 0.00200237 0.00197894 0.00198785 0.0020687  0.00207571\n",
      " 0.00207858 0.002022   0.00204254 0.00200756 0.00200588 0.00208502\n",
      " 0.00200408 0.00195171]\n",
      "2010-02-23 00:00:00\n",
      "66 500\n",
      "(66, 500, 3) (66, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0019711  0.00173934 0.00194451 0.00186563 0.00212948 0.00200189\n",
      " 0.0020103  0.00211073 0.00218552 0.00230249 0.00210007 0.00191125\n",
      " 0.00213498 0.00218664 0.00200463 0.00218521 0.00202983 0.0017728\n",
      " 0.00179907 0.00186782 0.00193161 0.00192931 0.00181879 0.00184335\n",
      " 0.00126818 0.0017436  0.002577   0.00207929 0.00228091 0.00204347\n",
      " 0.00178835 0.00193176 0.00257385 0.00198436 0.00192902 0.00179783\n",
      " 0.00225558 0.00191456 0.00186677 0.00185165 0.00194961 0.00207856\n",
      " 0.00126941 0.00182751 0.00172517 0.00184222 0.00199489 0.00208439\n",
      " 0.00207728 0.0018791  0.00204673 0.00213749 0.00186971 0.00220257\n",
      " 0.00173595 0.00208096 0.00199367 0.00189509 0.00172198 0.00195538\n",
      " 0.00185988 0.00201059 0.0022246  0.00194482 0.00234751 0.00202449\n",
      " 0.00206046 0.0017741  0.00217089 0.00209914 0.00201101 0.0020561\n",
      " 0.00190436 0.00189469 0.00243323 0.00201147 0.00188509 0.00208634\n",
      " 0.0022023  0.00226998 0.00263992 0.00232188 0.00192741 0.00218019\n",
      " 0.00178955 0.00181304 0.00197844 0.00223224 0.00190695 0.00222494\n",
      " 0.00192412 0.00194249 0.00165523 0.00226378 0.00206202 0.00168518\n",
      " 0.00157954 0.0021831  0.0020561  0.00183651 0.00208937 0.001659\n",
      " 0.00190419 0.00173697 0.00219233 0.00181014 0.00190644 0.00174511\n",
      " 0.00202688 0.00212444 0.002003   0.00191925 0.00214604 0.00190735\n",
      " 0.00191509 0.00209146 0.00202011 0.00209448 0.00188071 0.00191359\n",
      " 0.00221905 0.00189618 0.00185221 0.00186718 0.00185306 0.00185339\n",
      " 0.0019679  0.0017986  0.00209407 0.00208491 0.00221482 0.00200596\n",
      " 0.00200954 0.00196662 0.00169716 0.00185171 0.00199233 0.00200572\n",
      " 0.00196192 0.0021358  0.00212735 0.00165299 0.00193882 0.00200765\n",
      " 0.0021225  0.00212407 0.00208105 0.00187686 0.00216619 0.00171045\n",
      " 0.00177616 0.00213642 0.00204774 0.00216177 0.00173134 0.00210536\n",
      " 0.00200063 0.00158935 0.00192453 0.00196176 0.00166676 0.00205172\n",
      " 0.00188475 0.002051   0.00231033 0.00196663 0.0020069  0.00152407\n",
      " 0.00192984 0.00216041 0.00201779 0.00208763 0.0019323  0.00185376\n",
      " 0.00152835 0.00213538 0.00202703 0.00205397 0.0016223  0.00212629\n",
      " 0.0020201  0.00179708 0.00197357 0.00186599 0.00216909 0.0020561\n",
      " 0.0019588  0.00205136 0.00193263 0.00191379 0.00161683 0.00208986\n",
      " 0.00194549 0.00202137 0.00191789 0.00209112 0.0019899  0.00179249\n",
      " 0.00193464 0.00217795 0.00195176 0.00127935 0.00186838 0.00168672\n",
      " 0.00187156 0.0018435  0.00202587 0.00184691 0.00196029 0.00196684\n",
      " 0.00226806 0.00186609 0.00180513 0.00194392 0.00196029 0.00228916\n",
      " 0.00173204 0.00287067 0.00229768 0.00188835 0.00197608 0.00182596\n",
      " 0.0018121  0.00203402 0.0022688  0.00222016 0.0020739  0.00218371\n",
      " 0.00193391 0.00180195 0.00225779 0.0020006  0.0017536  0.00204165\n",
      " 0.00202728 0.00186553 0.00188221 0.00216475 0.0018181  0.00178524\n",
      " 0.00201241 0.00207323 0.00211591 0.00200985 0.00213734 0.00188026\n",
      " 0.00203919 0.00207012 0.00173356 0.00243325 0.00221905 0.00198925\n",
      " 0.00208563 0.00185517 0.00185419 0.00229294 0.00199569 0.00230082\n",
      " 0.00172226 0.00192139 0.00201115 0.00188243 0.00208579 0.00194471\n",
      " 0.00169305 0.00199451 0.0020561  0.00195841 0.00192453 0.00203091\n",
      " 0.002121   0.00197971 0.00189673 0.0019585  0.00177422 0.00184345\n",
      " 0.00220159 0.00201474 0.00176517 0.00190995 0.00177883 0.00216998\n",
      " 0.00177448 0.00225993 0.00173707 0.00254957 0.00204332 0.0018946\n",
      " 0.0022628  0.00206185 0.00198046 0.00190632 0.00213797 0.00174783\n",
      " 0.00192661 0.00209849 0.00186341 0.00209859 0.00213731 0.00212884\n",
      " 0.00207247 0.00204095 0.00208711 0.00214071 0.00194601 0.0021431\n",
      " 0.00228127 0.00214934 0.00216375 0.00205414 0.00186542 0.00193523\n",
      " 0.00218994 0.00210776 0.00166303 0.00210327 0.0020136  0.00190915\n",
      " 0.00157838 0.00215809 0.00206341 0.0016946  0.00236718 0.00186197\n",
      " 0.0019586  0.00230264 0.00195451 0.00210261 0.00207542 0.00184629\n",
      " 0.00198941 0.00195759 0.00216728 0.0020395  0.00209433 0.00163175\n",
      " 0.00214155 0.00181765 0.0020546  0.00223292 0.00198582 0.0024254\n",
      " 0.00215729 0.00199403 0.00208425 0.00200842 0.0019711  0.00216858\n",
      " 0.00188677 0.00184779 0.00172446 0.00190641 0.00163289 0.00201939\n",
      " 0.00215944 0.00214405 0.00191151 0.00177967 0.00208386 0.0019342\n",
      " 0.00199939 0.00221561 0.00183124 0.00212592 0.00215929 0.00208703\n",
      " 0.00223561 0.00192562 0.00185039 0.00223924 0.00201997 0.00224981\n",
      " 0.00215654 0.00222902 0.00192494 0.00232113 0.00214258 0.00184262\n",
      " 0.00196005 0.00183519 0.0021431  0.00222754 0.00203125 0.00218007\n",
      " 0.00189923 0.00194496 0.00195711 0.0020561  0.00201657 0.00209285\n",
      " 0.00207935 0.00202509 0.00214046 0.00201711 0.00198676 0.00210485\n",
      " 0.00195807 0.00214702 0.00208568 0.00222914 0.00173956 0.00189638\n",
      " 0.00207637 0.00200232 0.00201371 0.00229288 0.00181654 0.00227163\n",
      " 0.00219426 0.00209638 0.00208251 0.00194113 0.00146771 0.00199002\n",
      " 0.00196896 0.00220402 0.00178707 0.00216661 0.00209197 0.00181894\n",
      " 0.00196659 0.00225742 0.00207128 0.00215545 0.00217468 0.00161874\n",
      " 0.00178013 0.00204411 0.00184813 0.00157381 0.0020561  0.00176094\n",
      " 0.00214582 0.00216874 0.00227549 0.00201422 0.00127373 0.0018289\n",
      " 0.00210453 0.00185392 0.00189488 0.00213844 0.00184416 0.00195326\n",
      " 0.00182381 0.00272522 0.00169309 0.00191394 0.00210011 0.00200087\n",
      " 0.00175494 0.00191026 0.00196532 0.00217812 0.00208203 0.00177091\n",
      " 0.00193749 0.00219588 0.00211279 0.00210221 0.00226663 0.00218949\n",
      " 0.00128131 0.00214232 0.00215961 0.00172246 0.00202891 0.00218554\n",
      " 0.00218012 0.0016778  0.00209292 0.00211777 0.00234385 0.00207333\n",
      " 0.0020561  0.00189924 0.00187462 0.00201254 0.00223853 0.00208035\n",
      " 0.0022582  0.00215627 0.00194337 0.00208034 0.00219429 0.00212404\n",
      " 0.00189226 0.00192871 0.00193223 0.00209398 0.00231675 0.00221174\n",
      " 0.00203956 0.00210744 0.00226141 0.00217886 0.00229831 0.00210283\n",
      " 0.00208575 0.0020149 ]\n",
      "2010-02-24 00:00:00\n",
      "67 500\n",
      "(67, 500, 3) (67, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00252299 0.00250717 0.00151357 0.00246374 0.00175505 0.00193033\n",
      " 0.00214445 0.00159015 0.00200442 0.00144697 0.00211729 0.00227769\n",
      " 0.00155199 0.00200897 0.00220179 0.00202596 0.00210258 0.00223665\n",
      " 0.00249254 0.00222909 0.00168487 0.00213254 0.00220104 0.0017282\n",
      " 0.00238974 0.00222556 0.00220908 0.00216992 0.00201    0.00218305\n",
      " 0.0024021  0.00186744 0.00206645 0.00168175 0.00195928 0.00206416\n",
      " 0.00209395 0.00203154 0.00209484 0.00184274 0.00118386 0.00194851\n",
      " 0.00345582 0.00232161 0.00161221 0.00214364 0.00185384 0.0020395\n",
      " 0.00058581 0.002177   0.00200676 0.00201394 0.00216618 0.00181109\n",
      " 0.00233845 0.00174939 0.00174526 0.00218343 0.00233494 0.00212467\n",
      " 0.00238856 0.00216082 0.00164515 0.00197759 0.0015099  0.0019849\n",
      " 0.0022588  0.00233739 0.00166462 0.00201334 0.00199537 0.00238038\n",
      " 0.00208784 0.00166475 0.00230879 0.00220734 0.0014821  0.00179313\n",
      " 0.00203201 0.00212955 0.00221339 0.0018575  0.00188207 0.00184771\n",
      " 0.00227642 0.00195575 0.00194512 0.00207599 0.00229457 0.00207532\n",
      " 0.00201448 0.00167506 0.00267959 0.00180628 0.00186983 0.00230543\n",
      " 0.0019534  0.00057856 0.00243701 0.00158738 0.00191884 0.00246052\n",
      " 0.00254053 0.00204364 0.00193835 0.00142783 0.00220242 0.0022258\n",
      " 0.00174369 0.00184155 0.00213206 0.00224156 0.00170752 0.00223795\n",
      " 0.0018878  0.00174635 0.00241952 0.00197958 0.00218246 0.00202561\n",
      " 0.0019862  0.00160208 0.00196201 0.00186693 0.00179762 0.00139566\n",
      " 0.00170521 0.00221935 0.00245336 0.00204318 0.00194112 0.00199254\n",
      " 0.00129282 0.00234307 0.00209093 0.00237942 0.00225526 0.00193348\n",
      " 0.00220454 0.00143217 0.00144237 0.00185125 0.00163141 0.00195777\n",
      " 0.00148854 0.00144958 0.00197671 0.00220836 0.00057763 0.00201216\n",
      " 0.00198068 0.00193736 0.00210719 0.00199026 0.0023659  0.0005711\n",
      " 0.00235267 0.0021965  0.00195453 0.00213331 0.00236736 0.00162678\n",
      " 0.00201722 0.00197072 0.00213166 0.00216222 0.00198251 0.00243869\n",
      " 0.0023278  0.00205072 0.00194859 0.00152578 0.00204903 0.0021815\n",
      " 0.00235912 0.00187265 0.0013063  0.0015744  0.00153116 0.00167136\n",
      " 0.00211071 0.00213043 0.00226763 0.00200968 0.00201786 0.00238038\n",
      " 0.00226247 0.00195005 0.00218034 0.00223623 0.0023548  0.0020392\n",
      " 0.00222159 0.00243677 0.00206334 0.00199134 0.00109382 0.00238219\n",
      " 0.00222512 0.00203485 0.00218259 0.00226298 0.0023328  0.00250894\n",
      " 0.00234545 0.0021996  0.00199755 0.00238826 0.00211346 0.00208216\n",
      " 0.00209585 0.00230212 0.001953   0.00267629 0.00229999 0.00205396\n",
      " 0.00130069 0.00212859 0.00169942 0.00216408 0.0021457  0.00099294\n",
      " 0.00200755 0.002229   0.00207062 0.00159217 0.00190377 0.00175183\n",
      " 0.00231332 0.00235707 0.0017838  0.00195636 0.00227473 0.00057825\n",
      " 0.00248278 0.00338149 0.00184195 0.00163016 0.00238088 0.00227391\n",
      " 0.00215884 0.0019277  0.00201415 0.00183101 0.0020651  0.00196927\n",
      " 0.00266644 0.00208018 0.0030902  0.00193162 0.00177462 0.00096107\n",
      " 0.00186291 0.00254905 0.00252322 0.00223676 0.00201697 0.00217997\n",
      " 0.00234038 0.00221604 0.00230842 0.00243195 0.00206216 0.00253323\n",
      " 0.00236169 0.00176022 0.00238038 0.00203311 0.00198638 0.00154175\n",
      " 0.00200747 0.00224289 0.00215676 0.00214257 0.00188428 0.00229227\n",
      " 0.00138002 0.00190483 0.00232913 0.00241797 0.00212028 0.00206558\n",
      " 0.00260487 0.0020793  0.00224923 0.00293368 0.00179613 0.00229156\n",
      " 0.00209785 0.00176472 0.00209684 0.00227982 0.00110809 0.00222094\n",
      " 0.00194452 0.00180308 0.00222373 0.00223496 0.00178651 0.00203332\n",
      " 0.00187015 0.00203289 0.00143848 0.00195101 0.00201282 0.00141989\n",
      " 0.00202863 0.00161437 0.00185925 0.00199012 0.0025849  0.0016595\n",
      " 0.00179929 0.00189618 0.00288058 0.00195922 0.00191751 0.00235683\n",
      " 0.00201053 0.00188613 0.00206501 0.00243724 0.00139881 0.00215732\n",
      " 0.00203767 0.00165248 0.00166141 0.00201004 0.00195308 0.00253905\n",
      " 0.00199593 0.00181169 0.00214989 0.00202187 0.00164925 0.00225484\n",
      " 0.00158532 0.00191954 0.00169271 0.00180083 0.00174624 0.00227886\n",
      " 0.00193521 0.00174621 0.0020294  0.00214095 0.00205112 0.00208774\n",
      " 0.00189021 0.00222097 0.00248595 0.00205023 0.00195137 0.00202508\n",
      " 0.00168557 0.00157388 0.00216406 0.00203062 0.00203271 0.00206161\n",
      " 0.00210742 0.00257561 0.00204832 0.00204026 0.00200595 0.00213982\n",
      " 0.00187664 0.00181829 0.00245315 0.00213264 0.00172299 0.00057695\n",
      " 0.00179887 0.00197672 0.00198427 0.00177636 0.00058134 0.00265222\n",
      " 0.00196312 0.001896   0.00169855 0.00202689 0.00222223 0.00186486\n",
      " 0.00217481 0.00209332 0.00184102 0.00249684 0.0021836  0.00191177\n",
      " 0.00187037 0.00223876 0.0022754  0.00202681 0.00186046 0.00243298\n",
      " 0.00171121 0.00196275 0.00143264 0.00209302 0.00201274 0.00227748\n",
      " 0.00201069 0.00111013 0.00145911 0.00213607 0.00133965 0.00212496\n",
      " 0.00188961 0.00175719 0.00192693 0.00185542 0.00225599 0.00206478\n",
      " 0.00212568 0.00339231 0.0022406  0.00166375 0.00184357 0.0032314\n",
      " 0.0015215  0.00217419 0.00224847 0.00133642 0.00203538 0.00178564\n",
      " 0.00217853 0.00191305 0.00219901 0.00199531 0.00238038 0.00215377\n",
      " 0.00177768 0.00198776 0.00119841 0.0016531  0.00238057 0.0018456\n",
      " 0.0016756  0.00214761 0.00196369 0.00209952 0.00190463 0.00157609\n",
      " 0.00157922 0.00231865 0.00241975 0.00237353 0.00169504 0.00174894\n",
      " 0.00177427 0.00177775 0.0021062  0.00204362 0.00220387 0.00229658\n",
      " 0.001846   0.00200083 0.00189247 0.00206347 0.00203049 0.00183722\n",
      " 0.00248989 0.00193019 0.00091427 0.00247336 0.0026424  0.00189842\n",
      " 0.00184333 0.00177138 0.00157137 0.00205379 0.00174179 0.00209714\n",
      " 0.00246929 0.00232861 0.00212912 0.00153927 0.00194318 0.00225897\n",
      " 0.00209058 0.00174724 0.00189437 0.00193193 0.00206948 0.00184937\n",
      " 0.00237832 0.00130965 0.00222557 0.00174988 0.00218168 0.00154535\n",
      " 0.0016228  0.00143588 0.00179763 0.00180225 0.00169167 0.00171845\n",
      " 0.00119905 0.00200465]\n",
      "2010-02-25 00:00:00\n",
      "67 500\n",
      "(67, 500, 3) (67, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00191356 0.00196778 0.0016926  0.00205668 0.0018652  0.00184992\n",
      " 0.00213574 0.00213249 0.00187783 0.00202285 0.00222231 0.00211733\n",
      " 0.00216231 0.00157524 0.00212887 0.00197014 0.00172033 0.00217024\n",
      " 0.00082147 0.00237682 0.00225011 0.00197991 0.00208928 0.00218303\n",
      " 0.00224844 0.00179096 0.00187942 0.00165505 0.00191496 0.00174223\n",
      " 0.00242216 0.00224227 0.00166857 0.00201094 0.00182003 0.00240916\n",
      " 0.00177714 0.00205401 0.00210188 0.00193623 0.00165164 0.00165738\n",
      " 0.00209743 0.00216145 0.002204   0.00200847 0.00150987 0.00221693\n",
      " 0.00166545 0.00221906 0.00207937 0.00189491 0.00235039 0.00162261\n",
      " 0.00225647 0.00196731 0.00222136 0.00213606 0.00213635 0.00217263\n",
      " 0.00173764 0.00213751 0.00205236 0.00204591 0.00169643 0.00204635\n",
      " 0.00174075 0.00207772 0.00228591 0.00202147 0.00189914 0.00225594\n",
      " 0.00207599 0.00221245 0.0016776  0.00215242 0.00121949 0.00220538\n",
      " 0.00195756 0.00195925 0.00190447 0.00225968 0.00209736 0.00191724\n",
      " 0.0018703  0.00240216 0.00218596 0.00195467 0.0021074  0.00195594\n",
      " 0.00195419 0.00181553 0.00180533 0.00176001 0.00206769 0.00201527\n",
      " 0.00227518 0.00221897 0.00201783 0.00238245 0.00202148 0.00212927\n",
      " 0.00155047 0.00216544 0.00195781 0.00220708 0.00220619 0.00183635\n",
      " 0.00210929 0.00216098 0.00202076 0.00185379 0.00222522 0.00158583\n",
      " 0.00183987 0.00206436 0.00215358 0.00082046 0.0018901  0.00211062\n",
      " 0.00195291 0.00223649 0.00209464 0.00210183 0.00212963 0.00224078\n",
      " 0.00226501 0.00205417 0.00229071 0.00200846 0.00163824 0.00215449\n",
      " 0.00202875 0.00210737 0.00224357 0.00204915 0.00213488 0.0019287\n",
      " 0.0020884  0.0022271  0.00204996 0.00203121 0.00176079 0.00210281\n",
      " 0.00216574 0.00212227 0.00146121 0.00214601 0.00181764 0.00223157\n",
      " 0.00216343 0.00223332 0.00182541 0.00189007 0.00231316 0.00210527\n",
      " 0.00218048 0.00221564 0.00223503 0.00204577 0.00141094 0.00212933\n",
      " 0.00218188 0.00200011 0.00168929 0.0018883  0.00231741 0.002056\n",
      " 0.00219412 0.0020384  0.00184664 0.00250258 0.00221966 0.00208157\n",
      " 0.00214543 0.00202666 0.00208757 0.00228802 0.00218633 0.0021646\n",
      " 0.00204707 0.00222003 0.00200259 0.00213954 0.00175889 0.00221245\n",
      " 0.00205505 0.00200502 0.00181915 0.00209879 0.00184895 0.00208346\n",
      " 0.00206698 0.00181139 0.00226569 0.00202853 0.00217544 0.00220887\n",
      " 0.00210449 0.00178126 0.00200184 0.00220087 0.00214913 0.00210157\n",
      " 0.00209026 0.00192476 0.00190138 0.0021751  0.00197209 0.00208963\n",
      " 0.00180954 0.00206026 0.00217835 0.0019145  0.00207306 0.00167227\n",
      " 0.00229658 0.00171927 0.00199622 0.00213438 0.00194121 0.00224208\n",
      " 0.00225407 0.00176481 0.00180035 0.0020119  0.00211759 0.00151375\n",
      " 0.00196691 0.00162448 0.00211316 0.00191821 0.00194467 0.00259826\n",
      " 0.00196374 0.00082369 0.00211817 0.00146607 0.00209972 0.00215159\n",
      " 0.001871   0.00184264 0.00203263 0.00213864 0.0021388  0.00216418\n",
      " 0.00215885 0.00212772 0.00202118 0.00118849 0.00185704 0.0018326\n",
      " 0.00217137 0.00196634 0.000818   0.00180474 0.00147952 0.00158906\n",
      " 0.00198948 0.00224132 0.00175649 0.00207176 0.00190166 0.00083814\n",
      " 0.00189994 0.00217036 0.00221245 0.00222752 0.00221245 0.00213632\n",
      " 0.00182464 0.00217725 0.0019179  0.00219787 0.00220445 0.00189814\n",
      " 0.00172602 0.00205241 0.002376   0.00174296 0.00196969 0.00148153\n",
      " 0.00231034 0.00193349 0.00236095 0.00199595 0.00192467 0.00215707\n",
      " 0.00221245 0.00186038 0.00221245 0.00210977 0.0016434  0.00215655\n",
      " 0.00205042 0.00218617 0.00210824 0.00173968 0.00168418 0.00221245\n",
      " 0.00207674 0.00185458 0.00222533 0.0014948  0.00200569 0.00164742\n",
      " 0.00161407 0.0020165  0.00201386 0.00200304 0.00210351 0.00216245\n",
      " 0.00188137 0.00198774 0.00169687 0.00212105 0.00209799 0.0017747\n",
      " 0.00176816 0.00193322 0.00185809 0.00215153 0.00217493 0.00214978\n",
      " 0.00209223 0.0019703  0.00209837 0.00222066 0.00162899 0.00192718\n",
      " 0.00195838 0.00142764 0.0017673  0.00181642 0.00221055 0.00222113\n",
      " 0.00212273 0.00222608 0.0022426  0.00196012 0.00230347 0.0017402\n",
      " 0.00120782 0.00227097 0.00194396 0.00206983 0.00200384 0.0020122\n",
      " 0.00245166 0.0019615  0.00173395 0.00192968 0.00177759 0.00178115\n",
      " 0.00227632 0.00220878 0.00232571 0.00178005 0.001874   0.00210723\n",
      " 0.0019523  0.0016948  0.00229839 0.00192343 0.00178989 0.00178496\n",
      " 0.0019825  0.00216603 0.00222149 0.00209421 0.00194477 0.00168931\n",
      " 0.00166016 0.00161028 0.00216728 0.00228588 0.00222872 0.00133365\n",
      " 0.00205601 0.00189726 0.00229204 0.00177791 0.00215697 0.00183579\n",
      " 0.00223155 0.00218918 0.00212731 0.00220037 0.00208842 0.00196357\n",
      " 0.00209903 0.00209823 0.00200896 0.00210138 0.00225283 0.00234719\n",
      " 0.00190706 0.00205066 0.00174369 0.00201894 0.00194541 0.00163885\n",
      " 0.00214791 0.00226677 0.00217948 0.00184891 0.00209695 0.00178146\n",
      " 0.00186782 0.00170365 0.00210368 0.00217811 0.00221245 0.00210062\n",
      " 0.00184607 0.00136512 0.00266204 0.00212694 0.00205147 0.00176109\n",
      " 0.00231289 0.00144647 0.00199418 0.00221753 0.00117004 0.00221245\n",
      " 0.00210592 0.00188944 0.00222365 0.00219594 0.0022444  0.0022491\n",
      " 0.00216538 0.00197807 0.00204774 0.00227208 0.00142782 0.00223934\n",
      " 0.00216587 0.00189957 0.00221794 0.00220276 0.00219409 0.00222705\n",
      " 0.00230058 0.00206125 0.00222441 0.00214605 0.00138089 0.00203796\n",
      " 0.00184965 0.00195347 0.0026553  0.001954   0.00213048 0.00203974\n",
      " 0.0021087  0.00194464 0.00212636 0.00103521 0.00122839 0.00197262\n",
      " 0.00200498 0.00206729 0.00224687 0.0020849  0.00213171 0.00189757\n",
      " 0.00230948 0.00211454 0.00215452 0.00167672 0.00154253 0.00210192\n",
      " 0.0017305  0.00218417 0.00180251 0.00220177 0.00177394 0.00232438\n",
      " 0.00189415 0.00198396 0.00231389 0.00226927 0.00182778 0.0019375\n",
      " 0.00218092 0.00233418 0.00166371 0.00213378 0.00217142 0.00234121\n",
      " 0.00230825 0.00218885 0.00204689 0.00088729 0.00160511 0.00207994\n",
      " 0.00227521 0.00217314]\n",
      "2010-02-26 00:00:00\n",
      "67 500\n",
      "(67, 500, 3) (67, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00194305 0.00199738 0.00200772 0.0017904  0.00200568 0.00200788\n",
      " 0.0020013  0.00198163 0.00199417 0.00198361 0.00201293 0.00192362\n",
      " 0.00201487 0.0019937  0.0019909  0.00199313 0.00201234 0.001992\n",
      " 0.00203052 0.00202964 0.00193584 0.00200865 0.00201362 0.00201677\n",
      " 0.00195488 0.00194753 0.00202722 0.00201799 0.00199674 0.0020335\n",
      " 0.00199674 0.00199569 0.00201728 0.00186957 0.00198545 0.00201607\n",
      " 0.00200506 0.00203298 0.00200127 0.00202668 0.00190873 0.00200607\n",
      " 0.00190868 0.00191284 0.00186071 0.00202133 0.00197144 0.00201385\n",
      " 0.00202208 0.00197769 0.00200009 0.00198592 0.00200131 0.00199313\n",
      " 0.00203946 0.00199882 0.00201213 0.00202513 0.00200857 0.00200578\n",
      " 0.00196881 0.00201008 0.00196617 0.00197938 0.00199325 0.00203218\n",
      " 0.00202448 0.00197452 0.00196982 0.00200858 0.00201537 0.0020064\n",
      " 0.00196533 0.00199674 0.00193131 0.00202223 0.00200633 0.00199846\n",
      " 0.00200656 0.00197544 0.00203355 0.00192875 0.00199777 0.0020209\n",
      " 0.00203328 0.00189344 0.00198275 0.00199674 0.00199853 0.00198905\n",
      " 0.00202369 0.00198103 0.00203685 0.0020093  0.00200234 0.0020148\n",
      " 0.00199624 0.00200569 0.00199345 0.00189176 0.00196843 0.00200873\n",
      " 0.00199587 0.00202803 0.00202264 0.00197193 0.00187561 0.00201947\n",
      " 0.00198157 0.00195808 0.00202541 0.00201046 0.00199837 0.00202006\n",
      " 0.00202662 0.00197506 0.00198742 0.00200558 0.00201309 0.00202495\n",
      " 0.00200973 0.00199764 0.0020116  0.00192239 0.00201329 0.00195568\n",
      " 0.00202235 0.00203547 0.00196799 0.00197989 0.00198486 0.00199674\n",
      " 0.00204936 0.00201844 0.00203292 0.00200063 0.002043   0.00201863\n",
      " 0.00196102 0.00193581 0.00202046 0.00200681 0.00198937 0.00197782\n",
      " 0.00196328 0.00197408 0.00197587 0.00198187 0.00200963 0.00203498\n",
      " 0.00199816 0.00199674 0.00193816 0.00202414 0.00201134 0.00196559\n",
      " 0.00199038 0.00203448 0.00198765 0.00202751 0.00199505 0.001987\n",
      " 0.00198214 0.00193803 0.0020326  0.0020004  0.0019763  0.00199468\n",
      " 0.00204038 0.00198509 0.00201943 0.0019574  0.00200507 0.00200705\n",
      " 0.00199543 0.00200091 0.00202705 0.00202278 0.00198542 0.00200581\n",
      " 0.00199034 0.00200169 0.0019863  0.00196362 0.00200026 0.00199674\n",
      " 0.00204612 0.0019966  0.00193368 0.00200536 0.00202245 0.00200832\n",
      " 0.00198475 0.00203416 0.00201798 0.00195651 0.00196389 0.00201516\n",
      " 0.00199188 0.00199976 0.00203257 0.00198468 0.00202    0.00201014\n",
      " 0.00202707 0.00201352 0.00202924 0.00203508 0.00200763 0.00195746\n",
      " 0.00198581 0.00203425 0.0019845  0.00194694 0.00197346 0.00200745\n",
      " 0.00201627 0.00199082 0.00199539 0.00202851 0.00202669 0.00201313\n",
      " 0.00202071 0.00202351 0.00202414 0.00201597 0.00200867 0.00200918\n",
      " 0.00200012 0.00202481 0.00202279 0.00184219 0.00199687 0.00202196\n",
      " 0.00203031 0.00196721 0.00201884 0.00200809 0.00198264 0.00199556\n",
      " 0.00198025 0.00200535 0.00201411 0.00199547 0.00202977 0.00201004\n",
      " 0.00201187 0.00199647 0.00197813 0.00201682 0.00202179 0.00201143\n",
      " 0.00202498 0.00200808 0.00197119 0.00201376 0.00203823 0.00202043\n",
      " 0.0020246  0.00199618 0.00200357 0.00196288 0.00196    0.00203855\n",
      " 0.00202333 0.00196797 0.00199674 0.00198427 0.00200335 0.00197385\n",
      " 0.00201993 0.00202673 0.00200659 0.00198118 0.0020075  0.00188949\n",
      " 0.00198334 0.00191602 0.00198797 0.00203007 0.00199168 0.00202589\n",
      " 0.00195491 0.00203227 0.00186062 0.00192374 0.00197849 0.00197109\n",
      " 0.00199697 0.00199918 0.00199674 0.00200134 0.0019964  0.0020276\n",
      " 0.0019866  0.00201298 0.00199925 0.00202055 0.00202432 0.00199832\n",
      " 0.00193285 0.00201322 0.00200518 0.00198668 0.00201093 0.00182484\n",
      " 0.00201594 0.00201901 0.00200309 0.00199508 0.00202896 0.00196992\n",
      " 0.00197076 0.00199616 0.00200142 0.00199321 0.00182911 0.00202015\n",
      " 0.00201544 0.00200112 0.00200798 0.00201111 0.00198509 0.00201004\n",
      " 0.00199186 0.00199203 0.00187747 0.00202121 0.00198959 0.00199859\n",
      " 0.00199346 0.00200145 0.00198322 0.00201782 0.00198712 0.00199153\n",
      " 0.00201951 0.00201157 0.00202136 0.00200264 0.00203034 0.002011\n",
      " 0.0020027  0.00198211 0.00195156 0.00197214 0.0020186  0.00194865\n",
      " 0.001996   0.00202666 0.00202443 0.00202541 0.00200587 0.00200401\n",
      " 0.00200957 0.00199475 0.00199524 0.00203002 0.00202227 0.00200553\n",
      " 0.00199397 0.0019911  0.00199674 0.00197484 0.0020207  0.00201533\n",
      " 0.00201307 0.001984   0.00185201 0.00201249 0.00195647 0.00199148\n",
      " 0.0020257  0.00203339 0.00197799 0.00192    0.00202625 0.00201564\n",
      " 0.00200212 0.00201298 0.00199677 0.00200204 0.00198852 0.00202726\n",
      " 0.00192416 0.00199166 0.00195493 0.00438366 0.00200195 0.00200839\n",
      " 0.00201783 0.00201864 0.00203181 0.0019862  0.00191465 0.00192916\n",
      " 0.00193548 0.00200865 0.00200707 0.00201666 0.00196777 0.00202806\n",
      " 0.00201032 0.00203598 0.00199778 0.00203563 0.001988   0.00201809\n",
      " 0.00198769 0.00202594 0.00199423 0.00199674 0.00200278 0.0019722\n",
      " 0.0020265  0.00203081 0.00202966 0.00201289 0.00199103 0.0019527\n",
      " 0.00201616 0.00199475 0.00200648 0.00198585 0.00199674 0.00199895\n",
      " 0.0020075  0.00199578 0.00201079 0.00202841 0.00201268 0.00198791\n",
      " 0.00198752 0.00202352 0.00190419 0.00200055 0.00197995 0.00197987\n",
      " 0.00197408 0.00201729 0.00203435 0.00203196 0.00200477 0.00197112\n",
      " 0.00195456 0.00203933 0.00197764 0.00199546 0.00199787 0.00202768\n",
      " 0.00200299 0.00199578 0.00200246 0.00200069 0.00200612 0.00201172\n",
      " 0.00202346 0.00200499 0.00202242 0.00203103 0.00199132 0.00200544\n",
      " 0.00203842 0.00199237 0.00195397 0.00203188 0.00195189 0.00200124\n",
      " 0.00199024 0.00200075 0.00194909 0.00199674 0.00199492 0.00200223\n",
      " 0.00199889 0.00202929 0.00200558 0.0019144  0.00203189 0.00202425\n",
      " 0.00200832 0.00199491 0.00179954 0.00192834 0.00202179 0.00199903\n",
      " 0.00203862 0.00199006 0.00203751 0.00201119 0.00200726 0.00196735\n",
      " 0.00199674 0.00201287 0.002006   0.00200456 0.0020261  0.00202167\n",
      " 0.00201672 0.00200677]\n",
      "2010-03-01 00:00:00\n",
      "65 500\n",
      "(65, 500, 3) (65, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0020835  0.00192667 0.00274942 0.00105287 0.00163588 0.00202778\n",
      " 0.00209671 0.00210665 0.0021439  0.00200605 0.00213848 0.00221194\n",
      " 0.00189121 0.00194427 0.00182729 0.0020119  0.00188105 0.00208374\n",
      " 0.00205687 0.00173997 0.00169117 0.00178956 0.00197357 0.00211596\n",
      " 0.00221435 0.00106089 0.00169511 0.00182439 0.00214753 0.00207628\n",
      " 0.00213362 0.00191356 0.0017918  0.00194368 0.0020532  0.00143826\n",
      " 0.00187929 0.00204379 0.0019323  0.00224365 0.00199781 0.00209652\n",
      " 0.00219611 0.00215739 0.00212181 0.0018974  0.00198006 0.0018839\n",
      " 0.00195665 0.00199544 0.00198589 0.00201735 0.00200608 0.00231013\n",
      " 0.00210764 0.00191006 0.00203039 0.00172093 0.00192689 0.00194484\n",
      " 0.00223655 0.00200965 0.00217921 0.00204596 0.00182571 0.00218282\n",
      " 0.0020551  0.00210741 0.00207221 0.00199549 0.00190734 0.00226707\n",
      " 0.0014121  0.00211645 0.00220872 0.00211645 0.00124794 0.0020941\n",
      " 0.00201147 0.00203389 0.00105501 0.00213216 0.00211645 0.00186544\n",
      " 0.00169857 0.00209008 0.00209127 0.0021641  0.00211744 0.00208172\n",
      " 0.00179309 0.00208949 0.00209132 0.00200518 0.0019547  0.00231621\n",
      " 0.00201369 0.00206863 0.00215305 0.00205089 0.00212487 0.00201894\n",
      " 0.00225777 0.00154426 0.0017974  0.00214385 0.00184274 0.00192736\n",
      " 0.00208005 0.00214941 0.00180308 0.00195365 0.00207983 0.00224037\n",
      " 0.00162874 0.00186759 0.00176458 0.00203195 0.0019627  0.00223191\n",
      " 0.0019765  0.00202575 0.00193352 0.00193158 0.00202254 0.00194561\n",
      " 0.00183976 0.00201885 0.00216941 0.00214802 0.00219491 0.00214471\n",
      " 0.002345   0.00183543 0.00207322 0.00214617 0.00212311 0.00200799\n",
      " 0.0021053  0.00227271 0.00190012 0.00224934 0.00145925 0.0020856\n",
      " 0.00209021 0.00218005 0.00205522 0.00217939 0.00205253 0.00176734\n",
      " 0.0020765  0.00217322 0.00217033 0.00201375 0.00234525 0.00214209\n",
      " 0.00211645 0.00165455 0.00156692 0.00182806 0.00270483 0.00191733\n",
      " 0.0022205  0.00216226 0.0017778  0.00205931 0.00209214 0.0019025\n",
      " 0.00213897 0.00217809 0.00211141 0.00225419 0.00216103 0.00124751\n",
      " 0.00163415 0.00206112 0.00199808 0.00201725 0.00193728 0.00205966\n",
      " 0.00203682 0.00211428 0.00211073 0.00221417 0.00189629 0.00211645\n",
      " 0.0021649  0.00175103 0.00203843 0.00187619 0.00210812 0.00203316\n",
      " 0.00197301 0.00217137 0.0020459  0.00211209 0.00201287 0.0018195\n",
      " 0.00202236 0.00211111 0.00214932 0.00147753 0.00195648 0.00182939\n",
      " 0.00215002 0.00208056 0.00180663 0.00174501 0.00205575 0.00216408\n",
      " 0.00194423 0.00215467 0.00221343 0.00201827 0.00220681 0.00207158\n",
      " 0.0023798  0.00188564 0.00224034 0.00212287 0.00179239 0.00227902\n",
      " 0.00188824 0.00192571 0.00167516 0.00208405 0.00195732 0.0018016\n",
      " 0.00160969 0.00213957 0.00196374 0.00166305 0.00226339 0.00203247\n",
      " 0.00220158 0.00189737 0.00193449 0.00228725 0.00207164 0.00196845\n",
      " 0.00196948 0.00197493 0.00177005 0.00201911 0.00212531 0.00168341\n",
      " 0.00191825 0.0020902  0.00195891 0.00205359 0.00192482 0.00211883\n",
      " 0.00181804 0.00201584 0.00105663 0.00188354 0.00197275 0.001872\n",
      " 0.00212367 0.00206317 0.00202727 0.00179115 0.00232337 0.00158913\n",
      " 0.00192381 0.00190093 0.00211645 0.00213741 0.00143705 0.00227533\n",
      " 0.00195551 0.00211645 0.00218071 0.00226872 0.0018026  0.00194159\n",
      " 0.00220192 0.00220927 0.00143945 0.00202964 0.00214994 0.00191062\n",
      " 0.0020911  0.00178716 0.00215863 0.00201773 0.00192076 0.00203092\n",
      " 0.0018531  0.00202127 0.00214295 0.00195388 0.00222543 0.00196446\n",
      " 0.00195155 0.00207849 0.00211016 0.00236264 0.00182839 0.00212539\n",
      " 0.00230289 0.00209659 0.00211387 0.00218768 0.00187773 0.00247465\n",
      " 0.00214766 0.00198018 0.00192218 0.00214887 0.00231655 0.00228936\n",
      " 0.00228784 0.00197619 0.00233888 0.00188542 0.00213026 0.00212546\n",
      " 0.00221588 0.00200785 0.00215912 0.00193646 0.00231727 0.00126644\n",
      " 0.00192074 0.00202118 0.00211645 0.00193084 0.00219479 0.00193029\n",
      " 0.00172475 0.00149336 0.0021198  0.00211886 0.00256646 0.00211645\n",
      " 0.00189131 0.00200312 0.00209438 0.00200547 0.00214657 0.00178731\n",
      " 0.00205084 0.00207047 0.00196657 0.00224974 0.00190885 0.00208926\n",
      " 0.00106028 0.00192267 0.00194968 0.00199073 0.00212907 0.00215809\n",
      " 0.00201777 0.00191346 0.00189469 0.00185677 0.00192639 0.00204615\n",
      " 0.00204288 0.00132585 0.0021482  0.00212978 0.00207299 0.00210422\n",
      " 0.00194252 0.00214728 0.00177469 0.00205236 0.00191643 0.00198907\n",
      " 0.00210289 0.00193598 0.00207767 0.00214886 0.00199144 0.00162948\n",
      " 0.00194617 0.00200935 0.00189672 0.00163653 0.00200402 0.00203374\n",
      " 0.00206225 0.00187941 0.00211535 0.00149608 0.001934   0.00190546\n",
      " 0.00198493 0.00209487 0.00187701 0.00203523 0.00218415 0.00246891\n",
      " 0.00204358 0.0020066  0.00213917 0.00213508 0.00224981 0.0020933\n",
      " 0.00197316 0.00209324 0.00196864 0.00178644 0.00201763 0.0017798\n",
      " 0.00170883 0.00175097 0.00194716 0.00213229 0.00217281 0.0021164\n",
      " 0.00178675 0.00125179 0.00210356 0.00184421 0.00127681 0.00234385\n",
      " 0.00193816 0.00192421 0.00182211 0.0021127  0.00213924 0.0021654\n",
      " 0.00203635 0.00204045 0.0020227  0.00211645 0.00211645 0.00211645\n",
      " 0.00220066 0.00195528 0.00222213 0.00205108 0.0022072  0.00202138\n",
      " 0.00201556 0.00193161 0.00176493 0.00198189 0.00218075 0.0022057\n",
      " 0.00223261 0.00189934 0.00201794 0.00181691 0.00189631 0.00205497\n",
      " 0.00205321 0.00223424 0.00211092 0.00229089 0.00207689 0.0015745\n",
      " 0.00196251 0.00177953 0.00199143 0.00167949 0.00218024 0.00206026\n",
      " 0.00214167 0.00230524 0.00211645 0.00210188 0.00220076 0.00196056\n",
      " 0.00207111 0.0020592  0.00202515 0.00213862 0.00215176 0.00188914\n",
      " 0.00225576 0.00211663 0.0017479  0.00192458 0.00180193 0.00191158\n",
      " 0.00201335 0.00190761 0.00241254 0.00188822 0.00123846 0.00210899\n",
      " 0.00174966 0.00207387 0.00217606 0.00206561 0.00200155 0.00216645\n",
      " 0.00216396 0.00194037 0.00193426 0.00150066 0.00186319 0.00205673\n",
      " 0.00198782 0.0019916 ]\n",
      "2010-03-02 00:00:00\n",
      "66 500\n",
      "(66, 500, 3) (66, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0020158  0.00192207 0.00194807 0.00416732 0.00191211 0.00187427\n",
      " 0.00188343 0.00187644 0.00215328 0.00186484 0.00190625 0.00200728\n",
      " 0.00191331 0.00195349 0.00189963 0.00187814 0.00220952 0.00188816\n",
      " 0.00190883 0.00191791 0.00189436 0.00187484 0.00193088 0.00213398\n",
      " 0.00193009 0.00210944 0.00197075 0.00226256 0.00186971 0.00188748\n",
      " 0.00188084 0.00187659 0.00192713 0.00218432 0.00201447 0.00193878\n",
      " 0.0019043  0.00190155 0.00188588 0.002536   0.00187967 0.00199133\n",
      " 0.00195645 0.00186541 0.00201543 0.00194548 0.00190039 0.00188645\n",
      " 0.00309379 0.00196844 0.00186734 0.00415574 0.0019553  0.00195109\n",
      " 0.00211996 0.00234866 0.00251223 0.00200775 0.00188304 0.00204637\n",
      " 0.00188816 0.00189517 0.00207949 0.00219506 0.00224668 0.0018878\n",
      " 0.00196436 0.00186921 0.00198978 0.00187226 0.00195745 0.00223569\n",
      " 0.00206646 0.00188816 0.00201755 0.00188816 0.00239031 0.00198563\n",
      " 0.00192478 0.00187304 0.00191499 0.00192145 0.00188959 0.00187993\n",
      " 0.00187507 0.00187557 0.0018896  0.00186772 0.00188816 0.00188155\n",
      " 0.00190392 0.00189034 0.00212508 0.00187416 0.00194872 0.00282186\n",
      " 0.00187881 0.00204044 0.00190033 0.00189273 0.00209153 0.00189888\n",
      " 0.00193082 0.00187192 0.00191078 0.00209207 0.00194714 0.00189373\n",
      " 0.00199541 0.00191827 0.00187914 0.00186924 0.00187355 0.00200889\n",
      " 0.00199447 0.00192218 0.00188302 0.00193131 0.00187889 0.00188816\n",
      " 0.00188725 0.00187217 0.00197129 0.00187877 0.00191745 0.00192583\n",
      " 0.00189581 0.00188816 0.00187441 0.00188941 0.00187244 0.00188781\n",
      " 0.00219338 0.00194306 0.00219971 0.00187724 0.00257426 0.00187722\n",
      " 0.00187639 0.00188682 0.0021913  0.00203935 0.0018736  0.00203397\n",
      " 0.00263973 0.00187916 0.00193014 0.00187418 0.00188816 0.00211197\n",
      " 0.00186677 0.00197417 0.00202309 0.00356485 0.00207839 0.00201914\n",
      " 0.00188816 0.00191499 0.00188828 0.00196391 0.00196791 0.00200417\n",
      " 0.00187365 0.00193358 0.001912   0.00187168 0.00187033 0.00187539\n",
      " 0.00215334 0.00187866 0.00188353 0.00198771 0.00189703 0.0019447\n",
      " 0.00190589 0.00196325 0.00228958 0.00191032 0.00206391 0.00195641\n",
      " 0.00188263 0.00213216 0.00208359 0.00197873 0.00202623 0.00188816\n",
      " 0.00189285 0.00187061 0.00187406 0.00197142 0.00216081 0.00205198\n",
      " 0.0019381  0.00186953 0.00219478 0.00203567 0.00223364 0.0018748\n",
      " 0.00228238 0.00194195 0.00187087 0.00188816 0.00187442 0.0018772\n",
      " 0.00187446 0.00203413 0.002146   0.00189986 0.0018958  0.00188816\n",
      " 0.00188195 0.00251723 0.00187004 0.0021369  0.00191945 0.00199915\n",
      " 0.00188816 0.00195209 0.00217962 0.00189119 0.0018861  0.00189807\n",
      " 0.00186888 0.00207396 0.00192247 0.00190864 0.00192635 0.00187476\n",
      " 0.00189832 0.0019189  0.00187195 0.00198439 0.00228001 0.00192549\n",
      " 0.00189217 0.00230246 0.00187342 0.00189765 0.00192078 0.00198278\n",
      " 0.00193626 0.00190578 0.00189771 0.00187322 0.00220231 0.00186977\n",
      " 0.00191911 0.00189357 0.00187091 0.00194397 0.00191448 0.00187373\n",
      " 0.00190026 0.00204143 0.00205471 0.00191467 0.00187242 0.0018687\n",
      " 0.00188114 0.00192571 0.00187096 0.00189252 0.00189156 0.00195306\n",
      " 0.00255256 0.0022815  0.00188816 0.00192987 0.00257947 0.00187403\n",
      " 0.00187392 0.00188781 0.00190975 0.00216191 0.00192151 0.00200527\n",
      " 0.00192332 0.00190132 0.0023678  0.00188816 0.00193162 0.00187724\n",
      " 0.002039   0.00195858 0.00193158 0.00213171 0.00189703 0.00187337\n",
      " 0.00193002 0.00202299 0.00228774 0.00187926 0.00191025 0.00188058\n",
      " 0.00190959 0.00187657 0.00187028 0.00193302 0.00196252 0.00198458\n",
      " 0.00189395 0.00201692 0.00188148 0.0026792  0.00265417 0.00190231\n",
      " 0.00201538 0.00230054 0.00219994 0.0020192  0.00260686 0.00187794\n",
      " 0.00301997 0.00190929 0.00227675 0.002096   0.00249874 0.00193511\n",
      " 0.00189493 0.00200383 0.00187326 0.00187707 0.00191975 0.00215718\n",
      " 0.00187211 0.00188297 0.00188858 0.00194991 0.00187233 0.00198075\n",
      " 0.00196704 0.00187238 0.00221382 0.0019559  0.00188329 0.00188751\n",
      " 0.0019663  0.0019475  0.00192868 0.00199176 0.00233384 0.00190398\n",
      " 0.00192829 0.00192646 0.00187494 0.00199066 0.00188346 0.00207317\n",
      " 0.00189879 0.00190966 0.00197448 0.00197254 0.00186942 0.00189078\n",
      " 0.00201541 0.00186602 0.00187466 0.00190514 0.00189383 0.00191245\n",
      " 0.00186831 0.00187746 0.00187453 0.00195444 0.00207977 0.00199912\n",
      " 0.00193484 0.0018803  0.00251226 0.00187773 0.00186925 0.00188805\n",
      " 0.00187593 0.00187572 0.00230247 0.00193225 0.00191968 0.00192392\n",
      " 0.00194248 0.00189085 0.00188542 0.00189091 0.00193247 0.00193218\n",
      " 0.00196241 0.00187957 0.00194494 0.00227371 0.00187192 0.00201393\n",
      " 0.00191246 0.00186981 0.00198221 0.00244361 0.00196941 0.00193376\n",
      " 0.00238135 0.00189524 0.00188445 0.00193718 0.00194748 0.00196587\n",
      " 0.00186781 0.00207207 0.00186969 0.00192373 0.00192731 0.00187523\n",
      " 0.00187923 0.00187869 0.00186997 0.00186905 0.00203353 0.00190009\n",
      " 0.00189764 0.00216646 0.00188893 0.00206401 0.00191237 0.00210654\n",
      " 0.00195345 0.00188816 0.0018801  0.00197806 0.00195067 0.00279773\n",
      " 0.00187385 0.00187288 0.00190153 0.00188811 0.00188843 0.00188816\n",
      " 0.00215343 0.00191665 0.0018744  0.00188864 0.00188298 0.00204368\n",
      " 0.00198942 0.00187292 0.00188842 0.00188496 0.00192562 0.00201252\n",
      " 0.00186956 0.00218349 0.00360422 0.00187126 0.00191936 0.0023048\n",
      " 0.00243827 0.00191911 0.00229617 0.00201733 0.00188746 0.00190449\n",
      " 0.00192461 0.00188816 0.00199935 0.00189065 0.00192916 0.00193624\n",
      " 0.00200143 0.00188816 0.00188723 0.00191182 0.00189356 0.00188222\n",
      " 0.00186848 0.001874   0.00213645 0.001931   0.00201447 0.00199553\n",
      " 0.00188997 0.00415935 0.00188357 0.00189633 0.00196487 0.00193694\n",
      " 0.00187391 0.00189474 0.00188506 0.00189803 0.00225857 0.00194765\n",
      " 0.0018734  0.0023693  0.00189199 0.00188816 0.00188671 0.00189631\n",
      " 0.00193352 0.00193685 0.00187223 0.00189062 0.00206446 0.00229319\n",
      " 0.0018923  0.00192597]\n",
      "2010-03-03 00:00:00\n",
      "67 500\n",
      "(67, 500, 3) (67, 500)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/v-fech/trading-algo/MFM/mfm/portfolioopt.py:116: UserWarning: Convergence problem\n",
      "  warnings.warn(\"Convergence problem\")\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.00211765 0.00199612 0.00219405 0.00190673 0.00221127 0.00201139\n",
      " 0.00228966 0.00204872 0.00214229 0.00217075 0.00209088 0.00199447\n",
      " 0.00219345 0.00201148 0.00177228 0.00198141 0.00211905 0.00216024\n",
      " 0.00210344 0.00167767 0.00201849 0.00227876 0.00181729 0.00205741\n",
      " 0.00207698 0.00264501 0.00200656 0.00218408 0.00168674 0.00188612\n",
      " 0.00192093 0.00160393 0.00200762 0.00218313 0.0017732  0.00200532\n",
      " 0.00207275 0.00210602 0.00190162 0.00232204 0.00188296 0.0022055\n",
      " 0.00206361 0.00189053 0.00205573 0.00198973 0.00210029 0.00170997\n",
      " 0.00225053 0.00193763 0.00200118 0.00207326 0.00196334 0.00165069\n",
      " 0.00233275 0.00167416 0.00208173 0.00187802 0.00100966 0.00214593\n",
      " 0.00213463 0.00180181 0.0016507  0.00206674 0.00217626 0.00225827\n",
      " 0.00228532 0.0019362  0.00197141 0.00208382 0.00206252 0.00178436\n",
      " 0.00203002 0.0021724  0.00234696 0.00213463 0.0025725  0.00200851\n",
      " 0.00176882 0.00186506 0.002081   0.00163255 0.00167573 0.00212235\n",
      " 0.00209469 0.00218541 0.00235308 0.0019595  0.00219298 0.002102\n",
      " 0.00216208 0.00187224 0.00213384 0.00219929 0.00165231 0.00212276\n",
      " 0.00204965 0.0020652  0.00209492 0.00209104 0.0020138  0.0014968\n",
      " 0.00102215 0.00185996 0.00209144 0.00156539 0.00145587 0.00199367\n",
      " 0.00194396 0.00208774 0.00209333 0.00206938 0.00185987 0.00241378\n",
      " 0.0022272  0.00193783 0.0019151  0.00212481 0.00191694 0.00223714\n",
      " 0.00156436 0.00179211 0.00221074 0.00175781 0.00241023 0.00209908\n",
      " 0.00177334 0.00217847 0.00225239 0.00198998 0.00221178 0.00226408\n",
      " 0.00212535 0.00205373 0.00133001 0.0013096  0.00214464 0.00181\n",
      " 0.00180301 0.00162423 0.00146957 0.00216499 0.00183522 0.00177955\n",
      " 0.0013446  0.00209011 0.00227615 0.0018788  0.00216665 0.00215034\n",
      " 0.00188574 0.00189843 0.00199071 0.00268433 0.00217231 0.00166663\n",
      " 0.00213463 0.00206929 0.0021641  0.00201743 0.00206899 0.00231617\n",
      " 0.0019316  0.00201403 0.00207443 0.002119   0.00214847 0.00101484\n",
      " 0.00200973 0.00201134 0.0020088  0.00211299 0.00180748 0.00148079\n",
      " 0.00209935 0.00173462 0.00206908 0.00226296 0.00239559 0.00167642\n",
      " 0.0019531  0.00167207 0.00213333 0.0022202  0.00211464 0.00213463\n",
      " 0.00193404 0.00200488 0.00215025 0.00200604 0.00191692 0.00199089\n",
      " 0.00211972 0.0021022  0.00204531 0.0021466  0.00200913 0.00204092\n",
      " 0.00208871 0.00227205 0.00183009 0.00213463 0.00193384 0.00189539\n",
      " 0.00183604 0.00216036 0.00206923 0.0020404  0.00165904 0.00216454\n",
      " 0.00187888 0.00219981 0.00180923 0.00212785 0.00209955 0.00241814\n",
      " 0.00224401 0.00209378 0.00171309 0.00181877 0.00197356 0.00217444\n",
      " 0.00215246 0.00186679 0.00220495 0.00163506 0.00194778 0.00243641\n",
      " 0.00216235 0.00221486 0.00168873 0.00229259 0.0020706  0.00188813\n",
      " 0.00187253 0.00230377 0.00201035 0.00215796 0.00225044 0.00204532\n",
      " 0.00211994 0.00190891 0.00213619 0.00165942 0.00223847 0.00202544\n",
      " 0.00197743 0.0021389  0.00225615 0.00206371 0.0017849  0.00195712\n",
      " 0.00210708 0.00221069 0.00250801 0.00223411 0.00210846 0.00205328\n",
      " 0.00213856 0.00195511 0.00215504 0.00214235 0.00182027 0.00215519\n",
      " 0.00110159 0.00210608 0.00213463 0.00188788 0.00275403 0.00206778\n",
      " 0.00213463 0.00210224 0.00174277 0.00217912 0.00102125 0.00222676\n",
      " 0.00217868 0.00187114 0.00213995 0.00216683 0.00194885 0.00212454\n",
      " 0.0023154  0.00209087 0.0018184  0.0017986  0.00102164 0.00194296\n",
      " 0.0020345  0.0021415  0.00219951 0.00179951 0.00210195 0.00203177\n",
      " 0.00198882 0.00172782 0.00170448 0.00221653 0.00208833 0.00212239\n",
      " 0.00212568 0.00209429 0.0022045  0.00259442 0.00139837 0.00246819\n",
      " 0.00225058 0.00216265 0.00209538 0.00208838 0.00224604 0.00219607\n",
      " 0.00231169 0.00183421 0.00101946 0.00183303 0.00230851 0.00210079\n",
      " 0.00178015 0.00199731 0.00184399 0.00218276 0.0020859  0.00219092\n",
      " 0.00198756 0.00213463 0.00212938 0.00155716 0.00215749 0.0022222\n",
      " 0.00169581 0.00178892 0.00218705 0.0022183  0.00210197 0.00261975\n",
      " 0.00195171 0.00198313 0.00194485 0.00189361 0.00216262 0.00191394\n",
      " 0.00212928 0.00156022 0.00208357 0.00208828 0.00214452 0.00227512\n",
      " 0.00245777 0.0017976  0.00202674 0.00210409 0.00213463 0.00233518\n",
      " 0.00194966 0.00196953 0.00209563 0.00165996 0.00161406 0.00113514\n",
      " 0.0017051  0.00218606 0.00228222 0.00204052 0.00230165 0.00219791\n",
      " 0.00180751 0.00198646 0.00213463 0.00142626 0.00204215 0.00174648\n",
      " 0.00183822 0.0020539  0.00221364 0.00198514 0.0019088  0.00245965\n",
      " 0.0017347  0.00189539 0.00183816 0.00171562 0.00213463 0.00203068\n",
      " 0.00196575 0.00169467 0.00168194 0.00229634 0.00101294 0.00207803\n",
      " 0.00187954 0.00215023 0.00176435 0.00102395 0.00191323 0.00210953\n",
      " 0.00218322 0.00197151 0.00211073 0.00223997 0.00193762 0.00225316\n",
      " 0.00183486 0.00208517 0.0018676  0.00170689 0.00163018 0.00218226\n",
      " 0.00201987 0.00187048 0.00163581 0.00183644 0.00229603 0.00197453\n",
      " 0.00171638 0.00233043 0.0013608  0.00179241 0.00207175 0.00217677\n",
      " 0.00196601 0.00217135 0.00101372 0.00217667 0.00228362 0.00223259\n",
      " 0.00189851 0.00185655 0.00188445 0.00191501 0.00201269 0.00216853\n",
      " 0.00225238 0.00169408 0.00221785 0.00172455 0.0017195  0.00149319\n",
      " 0.00198638 0.00186683 0.00230091 0.00214725 0.00219073 0.00247412\n",
      " 0.00198695 0.00221248 0.00206168 0.00132087 0.00194782 0.00211111\n",
      " 0.0024165  0.00192541 0.00208725 0.00216324 0.00143254 0.00198721\n",
      " 0.00214909 0.00215463 0.00151339 0.00234771 0.00215978 0.00172272\n",
      " 0.00171246 0.00218981 0.00135736 0.00205123 0.00185716 0.00196298\n",
      " 0.00210865 0.00193383 0.00204582 0.00219129 0.00216523 0.00209119\n",
      " 0.00227035 0.00137892 0.0018939  0.00221429 0.00188158 0.00206453\n",
      " 0.0019244  0.00223371 0.00217343 0.00177994 0.00204903 0.0018311\n",
      " 0.00197232 0.00162626 0.00198481 0.00216351 0.00203252 0.00211434\n",
      " 0.00212699 0.00211577 0.00226634 0.00213308 0.00221726 0.00214917\n",
      " 0.00214184 0.00205553]\n",
      "2010-03-04 00:00:00\n",
      "67 500\n",
      "(67, 500, 3) (67, 500)\n",
      "[1.29104166e-08 1.64332997e-08 1.51093956e-08 8.42861689e-04\n",
      " 1.56776945e-08 3.07891719e-08 4.63682917e-07 2.59079912e-08\n",
      " 4.93473148e-08 1.43379196e-08 1.17106986e-08 1.37029558e-08\n",
      " 1.41912410e-08 3.43207476e-04 1.84834738e-08 1.54776235e-08\n",
      " 9.83178069e-09 1.54059364e-08 2.00861727e-08 9.14131688e-09\n",
      " 2.29783983e-08 1.36355900e-08 2.35814960e-08 1.46951426e-08\n",
      " 2.41333120e-08 2.79829062e-08 1.01691384e-03 9.60365757e-09\n",
      " 1.45119221e-08 1.40452451e-08 1.59692030e-08 9.23686353e-09\n",
      " 1.87284448e-04 8.63918042e-08 1.29854286e-08 1.35013115e-08\n",
      " 1.18150676e-08 1.22185109e-08 1.44892979e-08 1.05463168e-08\n",
      " 8.42041330e-09 4.96170299e-08 1.30592593e-03 3.38536610e-04\n",
      " 5.39842474e-08 1.04542641e-08 1.02871502e-08 9.78889478e-09\n",
      " 1.32624304e-08 1.00669527e-08 7.84066666e-04 7.39453360e-08\n",
      " 1.01494316e-08 1.09963550e-08 1.06473460e-08 1.11281574e-08\n",
      " 1.46332767e-08 8.88216313e-09 1.02055079e-08 1.21606182e-08\n",
      " 1.20303388e-01 2.56297851e-08 1.29712093e-08 1.11816986e-08\n",
      " 2.02709497e-07 1.04726308e-03 2.57488743e-08 2.32313091e-08\n",
      " 2.11513684e-08 7.91993346e-09 1.07909313e-08 1.13311691e-08\n",
      " 1.13627865e-08 4.88959344e-08 1.00442023e-08 1.20303388e-01\n",
      " 2.88042462e-08 2.53236461e-08 1.27650080e-08 1.16984905e-08\n",
      " 1.51376309e-03 1.05599502e-08 1.46818278e-08 1.26199320e-08\n",
      " 6.93944870e-09 1.38144053e-08 2.81440844e-06 1.36648826e-08\n",
      " 1.23092842e-08 2.68497849e-03 1.12865324e-08 1.76106828e-08\n",
      " 1.36134924e-08 1.01743579e-08 1.29609307e-08 1.04393290e-08\n",
      " 1.16736132e-08 9.78612947e-09 3.17275156e-08 3.24974417e-08\n",
      " 1.04696269e-08 1.00054146e-08 9.25829528e-09 8.85758930e-09\n",
      " 1.43001173e-08 7.25770305e-09 1.11120725e-08 1.28836890e-08\n",
      " 1.25094197e-08 1.19356691e-08 1.96017688e-08 1.19101216e-08\n",
      " 1.48255786e-08 6.74282352e-08 2.78952100e-08 4.69051829e-08\n",
      " 9.99853549e-09 1.28347466e-03 2.01007699e-08 1.85385971e-08\n",
      " 9.49726705e-09 1.63722553e-08 9.42562028e-09 1.19264120e-08\n",
      " 2.12137538e-08 9.85389764e-09 1.15787563e-08 3.80209426e-08\n",
      " 1.35275107e-08 2.23965726e-08 1.92130666e-08 2.23585223e-08\n",
      " 1.20303388e-01 1.51866392e-08 6.96850876e-09 1.08985939e-08\n",
      " 1.07464760e-08 1.41639824e-08 9.96485720e-09 9.68357511e-09\n",
      " 7.00524593e-09 1.25436407e-08 2.29482142e-08 1.42703409e-08\n",
      " 8.94512372e-09 9.60910803e-09 7.21054370e-09 1.66509873e-08\n",
      " 5.79482461e-04 9.42671129e-09 1.56367892e-08 1.15987788e-08\n",
      " 8.02390975e-09 1.15877947e-08 4.82630206e-04 1.16698806e-08\n",
      " 1.20303388e-01 1.57571581e-08 2.40534623e-08 1.45678620e-08\n",
      " 4.48431960e-08 2.36571483e-08 1.31188112e-08 1.09430329e-08\n",
      " 1.66301033e-08 1.82731087e-08 1.41779719e-08 9.70692724e-09\n",
      " 2.14332790e-08 1.42137610e-08 1.72969436e-08 1.73866131e-08\n",
      " 9.14432833e-09 1.20303388e-01 1.12898656e-08 1.48822794e-08\n",
      " 7.54876471e-04 1.35922130e-08 1.34195329e-08 1.17905563e-08\n",
      " 1.56067670e-08 8.39453450e-09 4.58167355e-08 2.63228975e-08\n",
      " 1.73084641e-08 1.20303388e-01 2.34834893e-08 9.80081498e-09\n",
      " 7.75101596e-04 1.66341887e-08 1.00117771e-08 1.33249140e-08\n",
      " 1.26916214e-08 1.13139240e-08 1.25195280e-08 1.44370601e-08\n",
      " 8.57289786e-09 1.32186893e-08 1.28244550e-08 1.90322793e-08\n",
      " 1.15304978e-08 1.20303388e-01 1.40059061e-08 1.27946661e-08\n",
      " 1.32017441e-08 1.26504176e-08 9.21913364e-09 1.58090291e-08\n",
      " 1.04886852e-08 2.92428955e-08 1.75806109e-08 1.77466659e-08\n",
      " 1.31191582e-08 9.27818207e-09 9.89361627e-04 1.40682711e-08\n",
      " 9.22647820e-09 2.56391865e-08 9.85475629e-09 1.38404447e-08\n",
      " 1.06224227e-08 9.60038137e-09 1.74778643e-07 1.30513640e-08\n",
      " 1.31308364e-08 1.35533420e-08 1.80751550e-08 2.13740285e-08\n",
      " 1.14155986e-08 1.55210805e-08 1.23412752e-08 2.71253202e-08\n",
      " 1.05418266e-08 1.81647182e-06 1.20113758e-08 8.78849688e-09\n",
      " 1.45086331e-08 1.11808686e-08 1.92972293e-08 1.10373476e-08\n",
      " 1.99872402e-03 1.55323065e-08 1.48577587e-08 1.36976435e-08\n",
      " 3.83810243e-08 1.14657478e-08 1.51428452e-08 1.59175426e-08\n",
      " 1.38655975e-08 8.32277895e-04 1.31211850e-08 1.24702257e-08\n",
      " 1.12539069e-08 1.41163461e-08 1.70804619e-08 1.68115089e-08\n",
      " 1.25737631e-08 6.26065573e-04 1.08242423e-08 1.57851639e-08\n",
      " 4.44544215e-08 8.26129353e-09 1.58488811e-03 8.23518443e-09\n",
      " 1.12314209e-08 2.61076395e-08 1.20303388e-01 9.37117458e-09\n",
      " 1.74920751e-08 1.59306214e-08 5.55450131e-05 1.08769568e-08\n",
      " 2.50039015e-08 8.84619184e-09 9.46852645e-09 1.89951000e-08\n",
      " 2.40842955e-08 1.40730090e-08 7.12889875e-09 1.10397031e-08\n",
      " 2.73914894e-08 1.32680458e-08 8.95669245e-09 2.68979392e-08\n",
      " 8.68906259e-09 1.22255480e-08 1.99811031e-08 1.69409706e-08\n",
      " 1.82113905e-08 1.22967536e-08 1.30490926e-08 1.02947501e-08\n",
      " 6.69749029e-05 7.19966031e-08 2.45674787e-08 1.32249388e-03\n",
      " 1.36394845e-08 1.11859240e-08 2.05674058e-03 3.88184120e-08\n",
      " 3.90310538e-08 4.21769472e-08 1.89271605e-08 5.15068571e-08\n",
      " 2.39642580e-08 2.07418456e-08 1.75763158e-03 9.44941457e-09\n",
      " 1.59081582e-08 1.13582452e-08 2.31360967e-08 1.15553033e-08\n",
      " 2.30105203e-03 1.33920326e-08 8.71980435e-09 5.21833014e-08\n",
      " 1.22596514e-08 1.28945231e-08 9.99008514e-09 1.75702639e-08\n",
      " 8.49227793e-09 2.09702647e-08 2.15924175e-08 1.09381535e-03\n",
      " 1.22583699e-08 4.74684960e-05 1.26171429e-08 1.48116037e-08\n",
      " 3.85193576e-08 9.71894681e-09 1.72662084e-03 9.04585834e-09\n",
      " 1.19687699e-08 4.98053089e-08 1.63357171e-08 5.24538465e-08\n",
      " 1.95671659e-08 1.02232249e-08 1.64029854e-08 1.19085491e-08\n",
      " 1.33201868e-08 1.65235864e-08 1.27692874e-03 1.05054891e-08\n",
      " 1.27196330e-08 8.19022676e-04 1.82745974e-03 1.89521381e-08\n",
      " 1.72034022e-08 9.42015538e-09 1.13195935e-08 1.39376384e-08\n",
      " 4.55440807e-05 6.82162938e-09 1.36819053e-08 1.21487929e-08\n",
      " 1.60719840e-08 1.33944200e-08 1.44292888e-08 7.61772624e-08\n",
      " 1.21315502e-08 7.73610434e-09 2.69836935e-08 2.10162789e-08\n",
      " 1.12567530e-08 1.61676086e-08 1.59304321e-08 8.81702573e-09\n",
      " 4.50536689e-05 1.20339816e-08 1.30710432e-08 7.57483855e-09\n",
      " 1.37281324e-08 3.34538519e-08 1.24527442e-08 1.11265056e-08\n",
      " 1.11363407e-08 1.38348944e-08 1.18518020e-08 9.17802490e-09\n",
      " 2.85729172e-08 2.60985195e-08 4.77543644e-05 1.23582026e-08\n",
      " 1.01228213e-08 1.04056719e-08 8.36475143e-09 8.96484470e-09\n",
      " 9.10661029e-09 1.20931829e-08 1.20747774e-08 1.73910082e-08\n",
      " 9.53381689e-09 2.15151766e-03 1.12477521e-08 3.18846945e-08\n",
      " 7.35503548e-08 1.44124076e-08 1.77879138e-08 1.73656409e-08\n",
      " 7.27431548e-09 1.54257247e-08 1.18275834e-08 1.12385159e-08\n",
      " 1.25748851e-08 7.31891996e-04 2.40620624e-08 1.26555250e-08\n",
      " 9.44933288e-09 1.14503022e-08 1.64268267e-08 1.71307869e-08\n",
      " 1.11660621e-08 2.50755159e-08 1.15271810e-08 1.19143755e-08\n",
      " 2.06655999e-08 1.31089545e-08 9.35493307e-09 1.25023227e-08\n",
      " 1.06177199e-08 9.91818745e-09 9.61022638e-09 2.44410152e-08\n",
      " 2.93282486e-08 8.24877610e-09 1.21956650e-08 1.44660257e-08\n",
      " 1.06500756e-08 1.64810695e-08 2.19947881e-08 1.66386005e-08\n",
      " 1.06190603e-08 1.52162104e-08 1.27947692e-08 2.82689351e-08\n",
      " 7.34025948e-09 9.11321735e-09 1.27635242e-08 1.21845766e-08\n",
      " 1.70439917e-08 2.33868774e-08 2.41728973e-08 1.36883377e-08\n",
      " 8.59233143e-09 1.31804417e-04 7.72960260e-09 6.72638193e-09\n",
      " 1.27501731e-08 7.96919265e-09 1.26274141e-08 8.40074142e-09\n",
      " 1.46951020e-08 1.41821369e-08 8.81531036e-09 1.17763429e-08\n",
      " 7.88474578e-09 4.15379689e-08 3.44726968e-08 8.30306505e-05\n",
      " 1.04620856e-08 1.14093884e-08 1.08287094e-08 2.94710367e-08\n",
      " 1.22120669e-08 1.42051512e-08 1.03025358e-08 1.25779961e-08\n",
      " 2.81797395e-08 1.12533771e-08 1.18552844e-08 2.69213918e-08\n",
      " 1.16171737e-08 1.42428533e-08 1.66893353e-08 8.14337731e-09\n",
      " 1.08533754e-08 1.26318811e-08 1.43685852e-08 1.41324197e-08\n",
      " 1.54047258e-08 1.43554024e-08 1.23528565e-08 1.65580745e-08\n",
      " 1.11719595e-08 1.38951537e-08 1.15062253e-08 8.58542886e-09\n",
      " 1.06607990e-08 1.15517326e-08 1.81249164e-08 1.25782857e-08\n",
      " 1.23554118e-08 2.72488606e-08 1.49433407e-08 1.24832899e-08\n",
      " 2.65446719e-08 9.99882587e-09 1.51257234e-08 1.54689530e-08]\n"
     ]
    }
   ],
   "source": [
    "from qlib.data import D\n",
    "from qlib.zoo import *\n",
    "from qlib.ops import *\n",
    "import numpy as np\n",
    "import datetime\n",
    "import time\n",
    "\n",
    "from mfm.MultiFactorModelCovariance import MultiFactorModelCovariance\n",
    "import mfm.portfolioopt as pfopt\n",
    "\n",
    "\n",
    "mfm_regressor=MultiFactorModelCovariance()\n",
    "\n",
    "\n",
    "'''\n",
    "停牌股可能会有问题，例如 SH600607 2010-02-04取过去100天只能取出71条，而其他都可以取出72条。\n",
    "如何处理NA的问题？\n",
    "\n",
    "padding?\n",
    "数据提前取多少？\n",
    "\n",
    "'''\n",
    "calendar=D.calendar(start_time='2010-02-04', end_time='2010-03-04', freq='day')\n",
    "instruments=D.instruments(market='csi500', start_time='2010-01-01', end_time='2010-01-01', as_list=True)\n",
    "fields = [PB(), Market_Value(), PE_TTM()]\n",
    "ret_fields=[ (Close() - Ref(Close(),1))/Ref(Close(),1)]\n",
    "for day in calendar:\n",
    "    print (day)\n",
    "    data=D.features(instruments, fields, start_time=day-datetime.timedelta(100), end_time=day, freq='day')\n",
    "    ret = D.features(instruments, ret_fields, start_time=day-datetime.timedelta(100), end_time=day, freq='day')\n",
    "    \n",
    "    \n",
    "    data_reset=data.reset_index()\n",
    "    ret_reset=ret.reset_index()\n",
    "    datetime_index=data_reset['datetime'].unique()\n",
    "    datetime_index=pd.DataFrame(datetime_index,columns=['datetime'])\n",
    "    stock_index=data_reset['instrument'].unique()\n",
    "    valid_day_num=datetime_index.shape[0]\n",
    "    valid_stock=stock_index.shape[0]\n",
    "    \n",
    "    \n",
    "    X=np.zeros([valid_stock,valid_day_num, len(fields)])\n",
    "    R = np.zeros([valid_stock,valid_day_num])\n",
    "    for i_stocks,stock in enumerate(stock_index):\n",
    "#         num=data_reset[data_reset['instrument']==stock].iloc[:,2:].shape\n",
    "        ss=data_reset[data_reset['instrument']==stock]\n",
    "        if ss.iloc[:,2:].shape[0]!=valid_day_num:\n",
    "            ss=pd.merge(ss,datetime_index,on=['datetime'],how='right')\n",
    "        X[i_stocks]=ss.iloc[:,2:].fillna(0).values\n",
    "    \n",
    "        ss=ret_reset[ret_reset['instrument']==stock]\n",
    "        if ss.iloc[:,2:].shape[0]!=valid_day_num:\n",
    "            ss=pd.merge(ss,datetime_index,on=['datetime'],how='right')\n",
    "        R[i_stocks]=ss.iloc[:,2].fillna(0).values\n",
    "        \n",
    "    \n",
    "    print(valid_day_num,valid_stock)\n",
    "    \n",
    "#     X=np.reshape(data.fillna(0).values,(valid_stock,valid_day_num, len(fields)))\n",
    "    \n",
    "    \n",
    "    N_stocks=valid_stock\n",
    "    N_features=len(fields)\n",
    "    N_T=valid_day_num\n",
    "    \n",
    "    X = np.transpose(X,[1,0,2])\n",
    "#     R = np.reshape(ret.fillna(0).values,(valid_stock,valid_day_num))\n",
    "    R = np.transpose(R,[1,0])\n",
    "    print(X.shape,R.shape)\n",
    "    cov = mfm_regressor.regress( X,R, N_stocks=N_stocks, N_features=N_features, N_T=N_T )\n",
    "    target_ret=0.001\n",
    "    calc_weights = pfopt.markowitz_portfolio(pd.DataFrame(cov), pd.Series(R[-1]), target_ret).values\n",
    "    print(calc_weights)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.30439401e+00,  3.03711155e+09, -2.24871597e+01],\n",
       "       [ 2.32575989e+00,  3.06527027e+09, -2.26956596e+01],\n",
       "       [ 2.26777005e+00,  2.98883942e+09, -2.21297665e+01],\n",
       "       [ 2.28760791e+00,  3.01498675e+09, -2.23233585e+01],\n",
       "       [ 2.32118106e+00,  3.05923610e+09, -2.26509743e+01],\n",
       "       [ 2.38985610e+00,  3.14974618e+09, -2.33211269e+01],\n",
       "       [ 2.42953396e+00,  3.20204083e+09, -2.37083282e+01],\n",
       "       [ 2.43258595e+00,  3.20606336e+09, -2.37381058e+01],\n",
       "       [ 2.45089793e+00,  3.23019930e+09, -2.39168053e+01],\n",
       "       [ 2.48752499e+00,  3.27847142e+09, -2.42742195e+01],\n",
       "       [ 2.46158195e+00,  3.24427878e+09, -2.40210629e+01],\n",
       "       [ 2.44021797e+00,  3.21612006e+09, -2.38125839e+01],\n",
       "       [ 2.49668193e+00,  3.29053926e+09, -2.43635826e+01],\n",
       "       [ 2.53330898e+00,  3.33881139e+09, -2.47209969e+01],\n",
       "       [ 2.58519602e+00,  3.40719667e+09, -2.52273331e+01],\n",
       "       [ 2.63250494e+00,  3.46954803e+09, -2.56889935e+01],\n",
       "       [ 2.62639999e+00,  3.46150272e+09, -2.56294193e+01],\n",
       "       [ 2.68744302e+00,  3.54195584e+09, -2.62250996e+01],\n",
       "       [ 2.66455102e+00,  3.51178598e+09, -2.60017147e+01],\n",
       "       [ 2.67675996e+00,  3.52787661e+09, -2.61208534e+01],\n",
       "       [ 2.53025603e+00,  3.33478861e+09, -2.46912079e+01],\n",
       "       [ 2.61571789e+00,  3.44742323e+09, -2.55251770e+01],\n",
       "       [ 2.72712111e+00,  3.59425050e+09, -2.66122932e+01],\n",
       "       [ 2.87057304e+00,  3.78331571e+09, -2.80121536e+01],\n",
       "       [ 2.94535208e+00,  3.88187110e+09, -2.87418709e+01],\n",
       "       [ 2.93772006e+00,  3.87181440e+09, -2.86674004e+01],\n",
       "       [ 3.03691506e+00,  4.00255104e+09, -2.96353836e+01],\n",
       "       [ 2.98044991e+00,  3.92813158e+09, -2.90843735e+01],\n",
       "       [ 2.81563091e+00,  3.71090790e+09, -2.74760075e+01],\n",
       "       [ 2.87820005e+00,  3.79337242e+09, -2.80865784e+01],\n",
       "       [ 2.96671295e+00,  3.91002957e+09, -2.89503269e+01],\n",
       "       [ 2.86294103e+00,  3.77325901e+09, -2.79376736e+01],\n",
       "       [ 2.88583302e+00,  3.80342912e+09, -2.81610622e+01],\n",
       "       [ 2.80800200e+00,  3.70085120e+09, -2.74015579e+01],\n",
       "       [ 2.73780203e+00,  3.60832973e+09, -2.67165184e+01],\n",
       "       [ 2.76985002e+00,  3.65056794e+09, -2.70292625e+01],\n",
       "       [ 2.79274011e+00,  3.68073779e+09, -2.72526321e+01],\n",
       "       [ 2.89956594e+00,  3.82153114e+09, -2.82950726e+01],\n",
       "       [ 2.78052998e+00,  3.66464717e+09, -2.71334763e+01],\n",
       "       [ 2.86598897e+00,  3.77728179e+09, -2.79674225e+01],\n",
       "       [ 2.91940308e+00,  3.84767846e+09, -2.84886513e+01],\n",
       "       [ 2.99113011e+00,  3.94221107e+09, -2.91885891e+01],\n",
       "       [ 3.02928090e+00,  3.99249434e+09, -2.95608902e+01],\n",
       "       [ 3.00791597e+00,  3.96433562e+09, -2.93523979e+01],\n",
       "       [ 3.13610697e+00,  4.13328742e+09, -3.06033363e+01],\n",
       "       [ 3.13610697e+00,  4.13328742e+09, -3.06033363e+01],\n",
       "       [ 3.09490204e+00,  4.07898163e+09, -3.02012405e+01],\n",
       "       [ 3.03538394e+00,  4.00053965e+09, -2.96204395e+01],\n",
       "       [ 3.12542200e+00,  4.11920819e+09, -3.04990711e+01],\n",
       "       [ 3.23987889e+00,  4.27005798e+09, -3.16159782e+01],\n",
       "       [ 3.16357303e+00,  4.16949146e+09, -3.08713589e+01],\n",
       "       [ 3.09032011e+00,  4.07294746e+09, -3.01565323e+01],\n",
       "       [ 3.16510010e+00,  4.17150285e+09, -3.08862591e+01],\n",
       "       [ 3.07353401e+00,  4.05082291e+09, -2.99927197e+01],\n",
       "       [ 3.10863304e+00,  4.09708365e+09, -3.03352375e+01],\n",
       "       [ 2.98807096e+00,  3.93818829e+09, -2.91587467e+01],\n",
       "       [ 3.06132388e+00,  4.03473229e+09, -2.98735714e+01],\n",
       "       [ 3.12084198e+00,  4.11317427e+09, -3.04543743e+01],\n",
       "       [ 3.15899396e+00,  4.16345754e+09, -3.08266792e+01],\n",
       "       [ 3.25361300e+00,  4.28816000e+09, -3.17500000e+01],\n",
       "       [ 3.14526105e+00,  4.14535552e+09, -3.06926613e+01],\n",
       "       [ 3.09184790e+00,  4.07495885e+09, -3.01714382e+01],\n",
       "       [ 2.89498401e+00,  3.81549696e+09, -2.82503624e+01],\n",
       "       [ 2.79273605e+00,  3.68073779e+09, -2.72525883e+01],\n",
       "       [ 2.73169208e+00,  3.60028442e+09, -2.66569004e+01],\n",
       "       [ 2.74847889e+00,  3.62240922e+09, -2.68207073e+01],\n",
       "       [ 2.71643090e+00,  3.58017126e+09, -2.65079784e+01],\n",
       "       [ 2.67064905e+00,  3.51983130e+09, -2.60612125e+01],\n",
       "       [ 2.55619311e+00,  3.36898125e+09, -2.49443073e+01],\n",
       "       [ 2.50888491e+00,  3.30663014e+09, -2.44826622e+01],\n",
       "       [ 2.56077099e+00,  3.37501542e+09, -2.49889889e+01],\n",
       "       [ 2.53788090e+00,  3.34484531e+09, -2.47656116e+01]])"
      ]
     },
     "execution_count": 185,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[:,499]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>pb</th>\n",
       "      <th>market_value</th>\n",
       "      <th>pe_ttm</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>instrument</th>\n",
       "      <th>datetime</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"30\" valign=\"top\">SH600012</th>\n",
       "      <th>2009-10-27</th>\n",
       "      <td>1.704725</td>\n",
       "      <td>6.177680e+09</td>\n",
       "      <td>12.846611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-10-28</th>\n",
       "      <td>1.711159</td>\n",
       "      <td>6.200992e+09</td>\n",
       "      <td>12.895094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-10-29</th>\n",
       "      <td>1.720808</td>\n",
       "      <td>6.235960e+09</td>\n",
       "      <td>12.967809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-10-30</th>\n",
       "      <td>1.730457</td>\n",
       "      <td>6.270928e+09</td>\n",
       "      <td>13.040520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-02</th>\n",
       "      <td>1.756189</td>\n",
       "      <td>6.364176e+09</td>\n",
       "      <td>13.234432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-03</th>\n",
       "      <td>1.775487</td>\n",
       "      <td>6.434112e+09</td>\n",
       "      <td>13.379866</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-04</th>\n",
       "      <td>1.785137</td>\n",
       "      <td>6.469080e+09</td>\n",
       "      <td>13.452585</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-05</th>\n",
       "      <td>1.810868</td>\n",
       "      <td>6.562328e+09</td>\n",
       "      <td>13.646491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-06</th>\n",
       "      <td>1.794786</td>\n",
       "      <td>6.504048e+09</td>\n",
       "      <td>13.525296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-09</th>\n",
       "      <td>1.804435</td>\n",
       "      <td>6.539016e+09</td>\n",
       "      <td>13.598008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-10</th>\n",
       "      <td>1.791569</td>\n",
       "      <td>6.492392e+09</td>\n",
       "      <td>13.501054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-11</th>\n",
       "      <td>1.814084</td>\n",
       "      <td>6.573984e+09</td>\n",
       "      <td>13.670722</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-12</th>\n",
       "      <td>1.804434</td>\n",
       "      <td>6.539016e+09</td>\n",
       "      <td>13.598008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-13</th>\n",
       "      <td>1.820517</td>\n",
       "      <td>6.597296e+09</td>\n",
       "      <td>13.719207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-16</th>\n",
       "      <td>1.888062</td>\n",
       "      <td>6.842072e+09</td>\n",
       "      <td>14.228217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-17</th>\n",
       "      <td>1.888062</td>\n",
       "      <td>6.842072e+09</td>\n",
       "      <td>14.228217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-18</th>\n",
       "      <td>1.910577</td>\n",
       "      <td>6.923664e+09</td>\n",
       "      <td>14.397888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-19</th>\n",
       "      <td>1.942742</td>\n",
       "      <td>7.040224e+09</td>\n",
       "      <td>14.640277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-20</th>\n",
       "      <td>1.936310</td>\n",
       "      <td>7.016912e+09</td>\n",
       "      <td>14.591803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-23</th>\n",
       "      <td>1.949176</td>\n",
       "      <td>7.063536e+09</td>\n",
       "      <td>14.688765</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-24</th>\n",
       "      <td>1.929878</td>\n",
       "      <td>6.993600e+09</td>\n",
       "      <td>14.543332</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-25</th>\n",
       "      <td>2.081051</td>\n",
       "      <td>7.541432e+09</td>\n",
       "      <td>15.682555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-26</th>\n",
       "      <td>1.997424</td>\n",
       "      <td>7.238376e+09</td>\n",
       "      <td>15.052351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-27</th>\n",
       "      <td>1.990990</td>\n",
       "      <td>7.215064e+09</td>\n",
       "      <td>15.003867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-11-30</th>\n",
       "      <td>2.052103</td>\n",
       "      <td>7.436528e+09</td>\n",
       "      <td>15.464411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-01</th>\n",
       "      <td>2.048888</td>\n",
       "      <td>7.424872e+09</td>\n",
       "      <td>15.440178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-02</th>\n",
       "      <td>2.036023</td>\n",
       "      <td>7.378248e+09</td>\n",
       "      <td>15.343230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-03</th>\n",
       "      <td>2.052105</td>\n",
       "      <td>7.436528e+09</td>\n",
       "      <td>15.464426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-04</th>\n",
       "      <td>1.984560</td>\n",
       "      <td>7.191752e+09</td>\n",
       "      <td>14.955414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-07</th>\n",
       "      <td>1.981343</td>\n",
       "      <td>7.180096e+09</td>\n",
       "      <td>14.931171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"30\" valign=\"top\">SZ002274</th>\n",
       "      <th>2009-12-24</th>\n",
       "      <td>3.029281</td>\n",
       "      <td>3.992494e+09</td>\n",
       "      <td>-29.560890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-25</th>\n",
       "      <td>3.007916</td>\n",
       "      <td>3.964336e+09</td>\n",
       "      <td>-29.352398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-28</th>\n",
       "      <td>3.136107</td>\n",
       "      <td>4.133287e+09</td>\n",
       "      <td>-30.603336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-29</th>\n",
       "      <td>3.136107</td>\n",
       "      <td>4.133287e+09</td>\n",
       "      <td>-30.603336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-30</th>\n",
       "      <td>3.094902</td>\n",
       "      <td>4.078982e+09</td>\n",
       "      <td>-30.201241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2009-12-31</th>\n",
       "      <td>3.035384</td>\n",
       "      <td>4.000540e+09</td>\n",
       "      <td>-29.620440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-04</th>\n",
       "      <td>3.125422</td>\n",
       "      <td>4.119208e+09</td>\n",
       "      <td>-30.499071</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-05</th>\n",
       "      <td>3.239879</td>\n",
       "      <td>4.270058e+09</td>\n",
       "      <td>-31.615978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-06</th>\n",
       "      <td>3.163573</td>\n",
       "      <td>4.169491e+09</td>\n",
       "      <td>-30.871359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-07</th>\n",
       "      <td>3.090320</td>\n",
       "      <td>4.072947e+09</td>\n",
       "      <td>-30.156532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-08</th>\n",
       "      <td>3.165100</td>\n",
       "      <td>4.171503e+09</td>\n",
       "      <td>-30.886259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-11</th>\n",
       "      <td>3.073534</td>\n",
       "      <td>4.050823e+09</td>\n",
       "      <td>-29.992720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-12</th>\n",
       "      <td>3.108633</td>\n",
       "      <td>4.097084e+09</td>\n",
       "      <td>-30.335238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-13</th>\n",
       "      <td>2.988071</td>\n",
       "      <td>3.938188e+09</td>\n",
       "      <td>-29.158747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-14</th>\n",
       "      <td>3.061324</td>\n",
       "      <td>4.034732e+09</td>\n",
       "      <td>-29.873571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-15</th>\n",
       "      <td>3.120842</td>\n",
       "      <td>4.113174e+09</td>\n",
       "      <td>-30.454374</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-18</th>\n",
       "      <td>3.158994</td>\n",
       "      <td>4.163458e+09</td>\n",
       "      <td>-30.826679</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-19</th>\n",
       "      <td>3.253613</td>\n",
       "      <td>4.288160e+09</td>\n",
       "      <td>-31.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-20</th>\n",
       "      <td>3.145261</td>\n",
       "      <td>4.145356e+09</td>\n",
       "      <td>-30.692661</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-21</th>\n",
       "      <td>3.091848</td>\n",
       "      <td>4.074959e+09</td>\n",
       "      <td>-30.171438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-22</th>\n",
       "      <td>2.894984</td>\n",
       "      <td>3.815497e+09</td>\n",
       "      <td>-28.250362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-25</th>\n",
       "      <td>2.792736</td>\n",
       "      <td>3.680738e+09</td>\n",
       "      <td>-27.252588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-26</th>\n",
       "      <td>2.731692</td>\n",
       "      <td>3.600284e+09</td>\n",
       "      <td>-26.656900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-27</th>\n",
       "      <td>2.748479</td>\n",
       "      <td>3.622409e+09</td>\n",
       "      <td>-26.820707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-28</th>\n",
       "      <td>2.716431</td>\n",
       "      <td>3.580171e+09</td>\n",
       "      <td>-26.507978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-01-29</th>\n",
       "      <td>2.670649</td>\n",
       "      <td>3.519831e+09</td>\n",
       "      <td>-26.061213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-02-01</th>\n",
       "      <td>2.556193</td>\n",
       "      <td>3.368981e+09</td>\n",
       "      <td>-24.944307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-02-02</th>\n",
       "      <td>2.508885</td>\n",
       "      <td>3.306630e+09</td>\n",
       "      <td>-24.482662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-02-03</th>\n",
       "      <td>2.560771</td>\n",
       "      <td>3.375015e+09</td>\n",
       "      <td>-24.988989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2010-02-04</th>\n",
       "      <td>2.537881</td>\n",
       "      <td>3.344845e+09</td>\n",
       "      <td>-24.765612</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>35998 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                             pb  market_value     pe_ttm\n",
       "instrument datetime                                     \n",
       "SH600012   2009-10-27  1.704725  6.177680e+09  12.846611\n",
       "           2009-10-28  1.711159  6.200992e+09  12.895094\n",
       "           2009-10-29  1.720808  6.235960e+09  12.967809\n",
       "           2009-10-30  1.730457  6.270928e+09  13.040520\n",
       "           2009-11-02  1.756189  6.364176e+09  13.234432\n",
       "           2009-11-03  1.775487  6.434112e+09  13.379866\n",
       "           2009-11-04  1.785137  6.469080e+09  13.452585\n",
       "           2009-11-05  1.810868  6.562328e+09  13.646491\n",
       "           2009-11-06  1.794786  6.504048e+09  13.525296\n",
       "           2009-11-09  1.804435  6.539016e+09  13.598008\n",
       "           2009-11-10  1.791569  6.492392e+09  13.501054\n",
       "           2009-11-11  1.814084  6.573984e+09  13.670722\n",
       "           2009-11-12  1.804434  6.539016e+09  13.598008\n",
       "           2009-11-13  1.820517  6.597296e+09  13.719207\n",
       "           2009-11-16  1.888062  6.842072e+09  14.228217\n",
       "           2009-11-17  1.888062  6.842072e+09  14.228217\n",
       "           2009-11-18  1.910577  6.923664e+09  14.397888\n",
       "           2009-11-19  1.942742  7.040224e+09  14.640277\n",
       "           2009-11-20  1.936310  7.016912e+09  14.591803\n",
       "           2009-11-23  1.949176  7.063536e+09  14.688765\n",
       "           2009-11-24  1.929878  6.993600e+09  14.543332\n",
       "           2009-11-25  2.081051  7.541432e+09  15.682555\n",
       "           2009-11-26  1.997424  7.238376e+09  15.052351\n",
       "           2009-11-27  1.990990  7.215064e+09  15.003867\n",
       "           2009-11-30  2.052103  7.436528e+09  15.464411\n",
       "           2009-12-01  2.048888  7.424872e+09  15.440178\n",
       "           2009-12-02  2.036023  7.378248e+09  15.343230\n",
       "           2009-12-03  2.052105  7.436528e+09  15.464426\n",
       "           2009-12-04  1.984560  7.191752e+09  14.955414\n",
       "           2009-12-07  1.981343  7.180096e+09  14.931171\n",
       "...                         ...           ...        ...\n",
       "SZ002274   2009-12-24  3.029281  3.992494e+09 -29.560890\n",
       "           2009-12-25  3.007916  3.964336e+09 -29.352398\n",
       "           2009-12-28  3.136107  4.133287e+09 -30.603336\n",
       "           2009-12-29  3.136107  4.133287e+09 -30.603336\n",
       "           2009-12-30  3.094902  4.078982e+09 -30.201241\n",
       "           2009-12-31  3.035384  4.000540e+09 -29.620440\n",
       "           2010-01-04  3.125422  4.119208e+09 -30.499071\n",
       "           2010-01-05  3.239879  4.270058e+09 -31.615978\n",
       "           2010-01-06  3.163573  4.169491e+09 -30.871359\n",
       "           2010-01-07  3.090320  4.072947e+09 -30.156532\n",
       "           2010-01-08  3.165100  4.171503e+09 -30.886259\n",
       "           2010-01-11  3.073534  4.050823e+09 -29.992720\n",
       "           2010-01-12  3.108633  4.097084e+09 -30.335238\n",
       "           2010-01-13  2.988071  3.938188e+09 -29.158747\n",
       "           2010-01-14  3.061324  4.034732e+09 -29.873571\n",
       "           2010-01-15  3.120842  4.113174e+09 -30.454374\n",
       "           2010-01-18  3.158994  4.163458e+09 -30.826679\n",
       "           2010-01-19  3.253613  4.288160e+09 -31.750000\n",
       "           2010-01-20  3.145261  4.145356e+09 -30.692661\n",
       "           2010-01-21  3.091848  4.074959e+09 -30.171438\n",
       "           2010-01-22  2.894984  3.815497e+09 -28.250362\n",
       "           2010-01-25  2.792736  3.680738e+09 -27.252588\n",
       "           2010-01-26  2.731692  3.600284e+09 -26.656900\n",
       "           2010-01-27  2.748479  3.622409e+09 -26.820707\n",
       "           2010-01-28  2.716431  3.580171e+09 -26.507978\n",
       "           2010-01-29  2.670649  3.519831e+09 -26.061213\n",
       "           2010-02-01  2.556193  3.368981e+09 -24.944307\n",
       "           2010-02-02  2.508885  3.306630e+09 -24.482662\n",
       "           2010-02-03  2.560771  3.375015e+09 -24.988989\n",
       "           2010-02-04  2.537881  3.344845e+09 -24.765612\n",
       "\n",
       "[35998 rows x 3 columns]"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_reset[]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instrument</th>\n",
       "      <th>datetime</th>\n",
       "      <th>pb</th>\n",
       "      <th>market_value</th>\n",
       "      <th>pe_ttm</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-10-27</td>\n",
       "      <td>3.628469</td>\n",
       "      <td>8.257443e+09</td>\n",
       "      <td>15.324516</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-10-28</td>\n",
       "      <td>3.562202</td>\n",
       "      <td>8.106639e+09</td>\n",
       "      <td>15.044644</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-10-29</td>\n",
       "      <td>3.571898</td>\n",
       "      <td>8.128708e+09</td>\n",
       "      <td>15.085596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-10-30</td>\n",
       "      <td>3.541528</td>\n",
       "      <td>8.183880e+09</td>\n",
       "      <td>15.338428</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-02</td>\n",
       "      <td>3.770732</td>\n",
       "      <td>8.713533e+09</td>\n",
       "      <td>16.331116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-03</td>\n",
       "      <td>3.726166</td>\n",
       "      <td>8.610545e+09</td>\n",
       "      <td>16.138098</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-04</td>\n",
       "      <td>3.708657</td>\n",
       "      <td>8.570085e+09</td>\n",
       "      <td>16.062265</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-05</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-06</td>\n",
       "      <td>3.732533</td>\n",
       "      <td>8.625257e+09</td>\n",
       "      <td>16.165674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-09</td>\n",
       "      <td>3.644990</td>\n",
       "      <td>8.422960e+09</td>\n",
       "      <td>15.786524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-10</td>\n",
       "      <td>3.646583</td>\n",
       "      <td>8.426637e+09</td>\n",
       "      <td>15.793423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-11</td>\n",
       "      <td>3.614748</td>\n",
       "      <td>8.353075e+09</td>\n",
       "      <td>15.655546</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-12</td>\n",
       "      <td>3.648174</td>\n",
       "      <td>8.430316e+09</td>\n",
       "      <td>15.800313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-13</td>\n",
       "      <td>3.786651</td>\n",
       "      <td>8.750314e+09</td>\n",
       "      <td>16.400061</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-16</td>\n",
       "      <td>3.815301</td>\n",
       "      <td>8.816521e+09</td>\n",
       "      <td>16.524143</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-17</td>\n",
       "      <td>3.820078</td>\n",
       "      <td>8.827556e+09</td>\n",
       "      <td>16.544832</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-18</td>\n",
       "      <td>3.785059</td>\n",
       "      <td>8.746636e+09</td>\n",
       "      <td>16.393166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-19</td>\n",
       "      <td>3.891703</td>\n",
       "      <td>8.993072e+09</td>\n",
       "      <td>16.855043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-20</td>\n",
       "      <td>3.821668</td>\n",
       "      <td>8.831234e+09</td>\n",
       "      <td>16.551720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-23</td>\n",
       "      <td>3.812118</td>\n",
       "      <td>8.809165e+09</td>\n",
       "      <td>16.510357</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-24</td>\n",
       "      <td>3.598830</td>\n",
       "      <td>8.316293e+09</td>\n",
       "      <td>15.586603</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-25</td>\n",
       "      <td>3.644988</td>\n",
       "      <td>8.422960e+09</td>\n",
       "      <td>15.786517</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-26</td>\n",
       "      <td>3.471494</td>\n",
       "      <td>8.022041e+09</td>\n",
       "      <td>15.035110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-27</td>\n",
       "      <td>3.485821</td>\n",
       "      <td>8.055144e+09</td>\n",
       "      <td>15.097160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-11-30</td>\n",
       "      <td>3.571774</td>\n",
       "      <td>8.253765e+09</td>\n",
       "      <td>15.469426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-01</td>\n",
       "      <td>3.621118</td>\n",
       "      <td>8.367787e+09</td>\n",
       "      <td>15.683136</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-02</td>\n",
       "      <td>3.621118</td>\n",
       "      <td>8.367787e+09</td>\n",
       "      <td>15.683136</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-03</td>\n",
       "      <td>3.625895</td>\n",
       "      <td>8.378822e+09</td>\n",
       "      <td>15.703822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-04</td>\n",
       "      <td>3.563819</td>\n",
       "      <td>8.235374e+09</td>\n",
       "      <td>15.434973</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-07</td>\n",
       "      <td>3.570188</td>\n",
       "      <td>8.250086e+09</td>\n",
       "      <td>15.462555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-24</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-28</td>\n",
       "      <td>3.546314</td>\n",
       "      <td>8.194914e+09</td>\n",
       "      <td>15.359156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-29</td>\n",
       "      <td>3.509705</td>\n",
       "      <td>8.110317e+09</td>\n",
       "      <td>15.200603</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-30</td>\n",
       "      <td>3.551088</td>\n",
       "      <td>8.205948e+09</td>\n",
       "      <td>15.379833</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2009-12-31</td>\n",
       "      <td>3.570190</td>\n",
       "      <td>8.250086e+09</td>\n",
       "      <td>15.462562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-04</td>\n",
       "      <td>3.544723</td>\n",
       "      <td>8.191236e+09</td>\n",
       "      <td>15.352267</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-05</td>\n",
       "      <td>3.552681</td>\n",
       "      <td>8.209627e+09</td>\n",
       "      <td>15.386733</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-06</td>\n",
       "      <td>3.590883</td>\n",
       "      <td>8.297903e+09</td>\n",
       "      <td>15.552186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-07</td>\n",
       "      <td>3.493789</td>\n",
       "      <td>8.073535e+09</td>\n",
       "      <td>15.131671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-08</td>\n",
       "      <td>3.458771</td>\n",
       "      <td>7.992616e+09</td>\n",
       "      <td>14.980006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-11</td>\n",
       "      <td>3.500155</td>\n",
       "      <td>8.088248e+09</td>\n",
       "      <td>15.159242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-12</td>\n",
       "      <td>3.552682</td>\n",
       "      <td>8.209627e+09</td>\n",
       "      <td>15.386737</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-13</td>\n",
       "      <td>3.629083</td>\n",
       "      <td>8.386178e+09</td>\n",
       "      <td>15.717628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-14</td>\n",
       "      <td>3.845554</td>\n",
       "      <td>8.886406e+09</td>\n",
       "      <td>16.655169</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-15</td>\n",
       "      <td>3.855102</td>\n",
       "      <td>8.908475e+09</td>\n",
       "      <td>16.696524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-18</td>\n",
       "      <td>3.880569</td>\n",
       "      <td>8.967326e+09</td>\n",
       "      <td>16.806822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-19</td>\n",
       "      <td>3.917178</td>\n",
       "      <td>9.051922e+09</td>\n",
       "      <td>16.965378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-20</td>\n",
       "      <td>3.719807</td>\n",
       "      <td>8.595833e+09</td>\n",
       "      <td>16.110559</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-21</td>\n",
       "      <td>3.800985</td>\n",
       "      <td>8.783418e+09</td>\n",
       "      <td>16.462139</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-22</td>\n",
       "      <td>3.804170</td>\n",
       "      <td>8.790774e+09</td>\n",
       "      <td>16.475935</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-25</td>\n",
       "      <td>3.831229</td>\n",
       "      <td>8.853302e+09</td>\n",
       "      <td>16.593128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-26</td>\n",
       "      <td>3.664099</td>\n",
       "      <td>8.467097e+09</td>\n",
       "      <td>15.869287</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-27</td>\n",
       "      <td>3.547903</td>\n",
       "      <td>8.198593e+09</td>\n",
       "      <td>15.366040</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-28</td>\n",
       "      <td>3.592472</td>\n",
       "      <td>8.301580e+09</td>\n",
       "      <td>15.559068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-01-29</td>\n",
       "      <td>3.667282</td>\n",
       "      <td>8.474454e+09</td>\n",
       "      <td>15.883070</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>68</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-02-01</td>\n",
       "      <td>3.912403</td>\n",
       "      <td>9.040888e+09</td>\n",
       "      <td>16.944695</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-02-02</td>\n",
       "      <td>3.734130</td>\n",
       "      <td>8.628936e+09</td>\n",
       "      <td>16.172592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>SH600607</td>\n",
       "      <td>2010-02-03</td>\n",
       "      <td>3.743682</td>\n",
       "      <td>8.651005e+09</td>\n",
       "      <td>16.213963</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>NaN</td>\n",
       "      <td>2010-02-04</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>72 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   instrument   datetime        pb  market_value     pe_ttm\n",
       "0    SH600607 2009-10-27  3.628469  8.257443e+09  15.324516\n",
       "1    SH600607 2009-10-28  3.562202  8.106639e+09  15.044644\n",
       "2    SH600607 2009-10-29  3.571898  8.128708e+09  15.085596\n",
       "3    SH600607 2009-10-30  3.541528  8.183880e+09  15.338428\n",
       "4    SH600607 2009-11-02  3.770732  8.713533e+09  16.331116\n",
       "5    SH600607 2009-11-03  3.726166  8.610545e+09  16.138098\n",
       "6    SH600607 2009-11-04  3.708657  8.570085e+09  16.062265\n",
       "7    SH600607 2009-11-05       NaN           NaN        NaN\n",
       "8    SH600607 2009-11-06  3.732533  8.625257e+09  16.165674\n",
       "9    SH600607 2009-11-09  3.644990  8.422960e+09  15.786524\n",
       "10   SH600607 2009-11-10  3.646583  8.426637e+09  15.793423\n",
       "11   SH600607 2009-11-11  3.614748  8.353075e+09  15.655546\n",
       "12   SH600607 2009-11-12  3.648174  8.430316e+09  15.800313\n",
       "13   SH600607 2009-11-13  3.786651  8.750314e+09  16.400061\n",
       "14   SH600607 2009-11-16  3.815301  8.816521e+09  16.524143\n",
       "15   SH600607 2009-11-17  3.820078  8.827556e+09  16.544832\n",
       "16   SH600607 2009-11-18  3.785059  8.746636e+09  16.393166\n",
       "17   SH600607 2009-11-19  3.891703  8.993072e+09  16.855043\n",
       "18   SH600607 2009-11-20  3.821668  8.831234e+09  16.551720\n",
       "19   SH600607 2009-11-23  3.812118  8.809165e+09  16.510357\n",
       "20   SH600607 2009-11-24  3.598830  8.316293e+09  15.586603\n",
       "21   SH600607 2009-11-25  3.644988  8.422960e+09  15.786517\n",
       "22   SH600607 2009-11-26  3.471494  8.022041e+09  15.035110\n",
       "23   SH600607 2009-11-27  3.485821  8.055144e+09  15.097160\n",
       "24   SH600607 2009-11-30  3.571774  8.253765e+09  15.469426\n",
       "25   SH600607 2009-12-01  3.621118  8.367787e+09  15.683136\n",
       "26   SH600607 2009-12-02  3.621118  8.367787e+09  15.683136\n",
       "27   SH600607 2009-12-03  3.625895  8.378822e+09  15.703822\n",
       "28   SH600607 2009-12-04  3.563819  8.235374e+09  15.434973\n",
       "29   SH600607 2009-12-07  3.570188  8.250086e+09  15.462555\n",
       "..        ...        ...       ...           ...        ...\n",
       "42   SH600607 2009-12-24       NaN           NaN        NaN\n",
       "43   SH600607 2009-12-25       NaN           NaN        NaN\n",
       "44   SH600607 2009-12-28  3.546314  8.194914e+09  15.359156\n",
       "45   SH600607 2009-12-29  3.509705  8.110317e+09  15.200603\n",
       "46   SH600607 2009-12-30  3.551088  8.205948e+09  15.379833\n",
       "47   SH600607 2009-12-31  3.570190  8.250086e+09  15.462562\n",
       "48   SH600607 2010-01-04  3.544723  8.191236e+09  15.352267\n",
       "49   SH600607 2010-01-05  3.552681  8.209627e+09  15.386733\n",
       "50   SH600607 2010-01-06  3.590883  8.297903e+09  15.552186\n",
       "51   SH600607 2010-01-07  3.493789  8.073535e+09  15.131671\n",
       "52   SH600607 2010-01-08  3.458771  7.992616e+09  14.980006\n",
       "53   SH600607 2010-01-11  3.500155  8.088248e+09  15.159242\n",
       "54   SH600607 2010-01-12  3.552682  8.209627e+09  15.386737\n",
       "55   SH600607 2010-01-13  3.629083  8.386178e+09  15.717628\n",
       "56   SH600607 2010-01-14  3.845554  8.886406e+09  16.655169\n",
       "57   SH600607 2010-01-15  3.855102  8.908475e+09  16.696524\n",
       "58   SH600607 2010-01-18  3.880569  8.967326e+09  16.806822\n",
       "59   SH600607 2010-01-19  3.917178  9.051922e+09  16.965378\n",
       "60   SH600607 2010-01-20  3.719807  8.595833e+09  16.110559\n",
       "61   SH600607 2010-01-21  3.800985  8.783418e+09  16.462139\n",
       "62   SH600607 2010-01-22  3.804170  8.790774e+09  16.475935\n",
       "63   SH600607 2010-01-25  3.831229  8.853302e+09  16.593128\n",
       "64   SH600607 2010-01-26  3.664099  8.467097e+09  15.869287\n",
       "65   SH600607 2010-01-27  3.547903  8.198593e+09  15.366040\n",
       "66   SH600607 2010-01-28  3.592472  8.301580e+09  15.559068\n",
       "67   SH600607 2010-01-29  3.667282  8.474454e+09  15.883070\n",
       "68   SH600607 2010-02-01  3.912403  9.040888e+09  16.944695\n",
       "69   SH600607 2010-02-02  3.734130  8.628936e+09  16.172592\n",
       "70   SH600607 2010-02-03  3.743682  8.651005e+09  16.213963\n",
       "71        NaN 2010-02-04       NaN           NaN        NaN\n",
       "\n",
       "[72 rows x 5 columns]"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [],
   "source": [
    "?pd.merge()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instrument</th>\n",
       "      <th>datetime</th>\n",
       "      <th>pb</th>\n",
       "      <th>market_value</th>\n",
       "      <th>pe_ttm</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-10-27</td>\n",
       "      <td>1.704725</td>\n",
       "      <td>6.177680e+09</td>\n",
       "      <td>12.846611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-10-28</td>\n",
       "      <td>1.711159</td>\n",
       "      <td>6.200992e+09</td>\n",
       "      <td>12.895094</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-10-29</td>\n",
       "      <td>1.720808</td>\n",
       "      <td>6.235960e+09</td>\n",
       "      <td>12.967809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-10-30</td>\n",
       "      <td>1.730457</td>\n",
       "      <td>6.270928e+09</td>\n",
       "      <td>13.040520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-02</td>\n",
       "      <td>1.756189</td>\n",
       "      <td>6.364176e+09</td>\n",
       "      <td>13.234432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-03</td>\n",
       "      <td>1.775487</td>\n",
       "      <td>6.434112e+09</td>\n",
       "      <td>13.379866</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-04</td>\n",
       "      <td>1.785137</td>\n",
       "      <td>6.469080e+09</td>\n",
       "      <td>13.452585</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-05</td>\n",
       "      <td>1.810868</td>\n",
       "      <td>6.562328e+09</td>\n",
       "      <td>13.646491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-06</td>\n",
       "      <td>1.794786</td>\n",
       "      <td>6.504048e+09</td>\n",
       "      <td>13.525296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-09</td>\n",
       "      <td>1.804435</td>\n",
       "      <td>6.539016e+09</td>\n",
       "      <td>13.598008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-10</td>\n",
       "      <td>1.791569</td>\n",
       "      <td>6.492392e+09</td>\n",
       "      <td>13.501054</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-11</td>\n",
       "      <td>1.814084</td>\n",
       "      <td>6.573984e+09</td>\n",
       "      <td>13.670722</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-12</td>\n",
       "      <td>1.804434</td>\n",
       "      <td>6.539016e+09</td>\n",
       "      <td>13.598008</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-13</td>\n",
       "      <td>1.820517</td>\n",
       "      <td>6.597296e+09</td>\n",
       "      <td>13.719207</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-16</td>\n",
       "      <td>1.888062</td>\n",
       "      <td>6.842072e+09</td>\n",
       "      <td>14.228217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-17</td>\n",
       "      <td>1.888062</td>\n",
       "      <td>6.842072e+09</td>\n",
       "      <td>14.228217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-18</td>\n",
       "      <td>1.910577</td>\n",
       "      <td>6.923664e+09</td>\n",
       "      <td>14.397888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-19</td>\n",
       "      <td>1.942742</td>\n",
       "      <td>7.040224e+09</td>\n",
       "      <td>14.640277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-20</td>\n",
       "      <td>1.936310</td>\n",
       "      <td>7.016912e+09</td>\n",
       "      <td>14.591803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-23</td>\n",
       "      <td>1.949176</td>\n",
       "      <td>7.063536e+09</td>\n",
       "      <td>14.688765</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-24</td>\n",
       "      <td>1.929878</td>\n",
       "      <td>6.993600e+09</td>\n",
       "      <td>14.543332</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-25</td>\n",
       "      <td>2.081051</td>\n",
       "      <td>7.541432e+09</td>\n",
       "      <td>15.682555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-26</td>\n",
       "      <td>1.997424</td>\n",
       "      <td>7.238376e+09</td>\n",
       "      <td>15.052351</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-27</td>\n",
       "      <td>1.990990</td>\n",
       "      <td>7.215064e+09</td>\n",
       "      <td>15.003867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-11-30</td>\n",
       "      <td>2.052103</td>\n",
       "      <td>7.436528e+09</td>\n",
       "      <td>15.464411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-12-01</td>\n",
       "      <td>2.048888</td>\n",
       "      <td>7.424872e+09</td>\n",
       "      <td>15.440178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-12-02</td>\n",
       "      <td>2.036023</td>\n",
       "      <td>7.378248e+09</td>\n",
       "      <td>15.343230</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-12-03</td>\n",
       "      <td>2.052105</td>\n",
       "      <td>7.436528e+09</td>\n",
       "      <td>15.464426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-12-04</td>\n",
       "      <td>1.984560</td>\n",
       "      <td>7.191752e+09</td>\n",
       "      <td>14.955414</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>SH600012</td>\n",
       "      <td>2009-12-07</td>\n",
       "      <td>1.981343</td>\n",
       "      <td>7.180096e+09</td>\n",
       "      <td>14.931171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35968</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-24</td>\n",
       "      <td>3.029281</td>\n",
       "      <td>3.992494e+09</td>\n",
       "      <td>-29.560890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35969</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-25</td>\n",
       "      <td>3.007916</td>\n",
       "      <td>3.964336e+09</td>\n",
       "      <td>-29.352398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35970</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-28</td>\n",
       "      <td>3.136107</td>\n",
       "      <td>4.133287e+09</td>\n",
       "      <td>-30.603336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35971</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-29</td>\n",
       "      <td>3.136107</td>\n",
       "      <td>4.133287e+09</td>\n",
       "      <td>-30.603336</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35972</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-30</td>\n",
       "      <td>3.094902</td>\n",
       "      <td>4.078982e+09</td>\n",
       "      <td>-30.201241</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35973</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2009-12-31</td>\n",
       "      <td>3.035384</td>\n",
       "      <td>4.000540e+09</td>\n",
       "      <td>-29.620440</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35974</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-04</td>\n",
       "      <td>3.125422</td>\n",
       "      <td>4.119208e+09</td>\n",
       "      <td>-30.499071</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35975</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-05</td>\n",
       "      <td>3.239879</td>\n",
       "      <td>4.270058e+09</td>\n",
       "      <td>-31.615978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35976</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-06</td>\n",
       "      <td>3.163573</td>\n",
       "      <td>4.169491e+09</td>\n",
       "      <td>-30.871359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35977</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-07</td>\n",
       "      <td>3.090320</td>\n",
       "      <td>4.072947e+09</td>\n",
       "      <td>-30.156532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35978</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-08</td>\n",
       "      <td>3.165100</td>\n",
       "      <td>4.171503e+09</td>\n",
       "      <td>-30.886259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35979</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-11</td>\n",
       "      <td>3.073534</td>\n",
       "      <td>4.050823e+09</td>\n",
       "      <td>-29.992720</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35980</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-12</td>\n",
       "      <td>3.108633</td>\n",
       "      <td>4.097084e+09</td>\n",
       "      <td>-30.335238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35981</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-13</td>\n",
       "      <td>2.988071</td>\n",
       "      <td>3.938188e+09</td>\n",
       "      <td>-29.158747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35982</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-14</td>\n",
       "      <td>3.061324</td>\n",
       "      <td>4.034732e+09</td>\n",
       "      <td>-29.873571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35983</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-15</td>\n",
       "      <td>3.120842</td>\n",
       "      <td>4.113174e+09</td>\n",
       "      <td>-30.454374</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35984</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-18</td>\n",
       "      <td>3.158994</td>\n",
       "      <td>4.163458e+09</td>\n",
       "      <td>-30.826679</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35985</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-19</td>\n",
       "      <td>3.253613</td>\n",
       "      <td>4.288160e+09</td>\n",
       "      <td>-31.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35986</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-20</td>\n",
       "      <td>3.145261</td>\n",
       "      <td>4.145356e+09</td>\n",
       "      <td>-30.692661</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35987</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-21</td>\n",
       "      <td>3.091848</td>\n",
       "      <td>4.074959e+09</td>\n",
       "      <td>-30.171438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35988</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-22</td>\n",
       "      <td>2.894984</td>\n",
       "      <td>3.815497e+09</td>\n",
       "      <td>-28.250362</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35989</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-25</td>\n",
       "      <td>2.792736</td>\n",
       "      <td>3.680738e+09</td>\n",
       "      <td>-27.252588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35990</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-26</td>\n",
       "      <td>2.731692</td>\n",
       "      <td>3.600284e+09</td>\n",
       "      <td>-26.656900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35991</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-27</td>\n",
       "      <td>2.748479</td>\n",
       "      <td>3.622409e+09</td>\n",
       "      <td>-26.820707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35992</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-28</td>\n",
       "      <td>2.716431</td>\n",
       "      <td>3.580171e+09</td>\n",
       "      <td>-26.507978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35993</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-01-29</td>\n",
       "      <td>2.670649</td>\n",
       "      <td>3.519831e+09</td>\n",
       "      <td>-26.061213</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35994</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-02-01</td>\n",
       "      <td>2.556193</td>\n",
       "      <td>3.368981e+09</td>\n",
       "      <td>-24.944307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35995</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-02-02</td>\n",
       "      <td>2.508885</td>\n",
       "      <td>3.306630e+09</td>\n",
       "      <td>-24.482662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35996</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-02-03</td>\n",
       "      <td>2.560771</td>\n",
       "      <td>3.375015e+09</td>\n",
       "      <td>-24.988989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35997</th>\n",
       "      <td>SZ002274</td>\n",
       "      <td>2010-02-04</td>\n",
       "      <td>2.537881</td>\n",
       "      <td>3.344845e+09</td>\n",
       "      <td>-24.765612</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>35998 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      instrument   datetime        pb  market_value     pe_ttm\n",
       "0       SH600012 2009-10-27  1.704725  6.177680e+09  12.846611\n",
       "1       SH600012 2009-10-28  1.711159  6.200992e+09  12.895094\n",
       "2       SH600012 2009-10-29  1.720808  6.235960e+09  12.967809\n",
       "3       SH600012 2009-10-30  1.730457  6.270928e+09  13.040520\n",
       "4       SH600012 2009-11-02  1.756189  6.364176e+09  13.234432\n",
       "5       SH600012 2009-11-03  1.775487  6.434112e+09  13.379866\n",
       "6       SH600012 2009-11-04  1.785137  6.469080e+09  13.452585\n",
       "7       SH600012 2009-11-05  1.810868  6.562328e+09  13.646491\n",
       "8       SH600012 2009-11-06  1.794786  6.504048e+09  13.525296\n",
       "9       SH600012 2009-11-09  1.804435  6.539016e+09  13.598008\n",
       "10      SH600012 2009-11-10  1.791569  6.492392e+09  13.501054\n",
       "11      SH600012 2009-11-11  1.814084  6.573984e+09  13.670722\n",
       "12      SH600012 2009-11-12  1.804434  6.539016e+09  13.598008\n",
       "13      SH600012 2009-11-13  1.820517  6.597296e+09  13.719207\n",
       "14      SH600012 2009-11-16  1.888062  6.842072e+09  14.228217\n",
       "15      SH600012 2009-11-17  1.888062  6.842072e+09  14.228217\n",
       "16      SH600012 2009-11-18  1.910577  6.923664e+09  14.397888\n",
       "17      SH600012 2009-11-19  1.942742  7.040224e+09  14.640277\n",
       "18      SH600012 2009-11-20  1.936310  7.016912e+09  14.591803\n",
       "19      SH600012 2009-11-23  1.949176  7.063536e+09  14.688765\n",
       "20      SH600012 2009-11-24  1.929878  6.993600e+09  14.543332\n",
       "21      SH600012 2009-11-25  2.081051  7.541432e+09  15.682555\n",
       "22      SH600012 2009-11-26  1.997424  7.238376e+09  15.052351\n",
       "23      SH600012 2009-11-27  1.990990  7.215064e+09  15.003867\n",
       "24      SH600012 2009-11-30  2.052103  7.436528e+09  15.464411\n",
       "25      SH600012 2009-12-01  2.048888  7.424872e+09  15.440178\n",
       "26      SH600012 2009-12-02  2.036023  7.378248e+09  15.343230\n",
       "27      SH600012 2009-12-03  2.052105  7.436528e+09  15.464426\n",
       "28      SH600012 2009-12-04  1.984560  7.191752e+09  14.955414\n",
       "29      SH600012 2009-12-07  1.981343  7.180096e+09  14.931171\n",
       "...          ...        ...       ...           ...        ...\n",
       "35968   SZ002274 2009-12-24  3.029281  3.992494e+09 -29.560890\n",
       "35969   SZ002274 2009-12-25  3.007916  3.964336e+09 -29.352398\n",
       "35970   SZ002274 2009-12-28  3.136107  4.133287e+09 -30.603336\n",
       "35971   SZ002274 2009-12-29  3.136107  4.133287e+09 -30.603336\n",
       "35972   SZ002274 2009-12-30  3.094902  4.078982e+09 -30.201241\n",
       "35973   SZ002274 2009-12-31  3.035384  4.000540e+09 -29.620440\n",
       "35974   SZ002274 2010-01-04  3.125422  4.119208e+09 -30.499071\n",
       "35975   SZ002274 2010-01-05  3.239879  4.270058e+09 -31.615978\n",
       "35976   SZ002274 2010-01-06  3.163573  4.169491e+09 -30.871359\n",
       "35977   SZ002274 2010-01-07  3.090320  4.072947e+09 -30.156532\n",
       "35978   SZ002274 2010-01-08  3.165100  4.171503e+09 -30.886259\n",
       "35979   SZ002274 2010-01-11  3.073534  4.050823e+09 -29.992720\n",
       "35980   SZ002274 2010-01-12  3.108633  4.097084e+09 -30.335238\n",
       "35981   SZ002274 2010-01-13  2.988071  3.938188e+09 -29.158747\n",
       "35982   SZ002274 2010-01-14  3.061324  4.034732e+09 -29.873571\n",
       "35983   SZ002274 2010-01-15  3.120842  4.113174e+09 -30.454374\n",
       "35984   SZ002274 2010-01-18  3.158994  4.163458e+09 -30.826679\n",
       "35985   SZ002274 2010-01-19  3.253613  4.288160e+09 -31.750000\n",
       "35986   SZ002274 2010-01-20  3.145261  4.145356e+09 -30.692661\n",
       "35987   SZ002274 2010-01-21  3.091848  4.074959e+09 -30.171438\n",
       "35988   SZ002274 2010-01-22  2.894984  3.815497e+09 -28.250362\n",
       "35989   SZ002274 2010-01-25  2.792736  3.680738e+09 -27.252588\n",
       "35990   SZ002274 2010-01-26  2.731692  3.600284e+09 -26.656900\n",
       "35991   SZ002274 2010-01-27  2.748479  3.622409e+09 -26.820707\n",
       "35992   SZ002274 2010-01-28  2.716431  3.580171e+09 -26.507978\n",
       "35993   SZ002274 2010-01-29  2.670649  3.519831e+09 -26.061213\n",
       "35994   SZ002274 2010-02-01  2.556193  3.368981e+09 -24.944307\n",
       "35995   SZ002274 2010-02-02  2.508885  3.306630e+09 -24.482662\n",
       "35996   SZ002274 2010-02-03  2.560771  3.375015e+09 -24.988989\n",
       "35997   SZ002274 2010-02-04  2.537881  3.344845e+09 -24.765612\n",
       "\n",
       "[35998 rows x 5 columns]"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.reset_index(drop=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
